Read STRING AS XML TO SHOW LIST

Hi, what i do is read a web page as string
And read the string as xml
Now i want to do a

foreach (server in servers){
 servername = server.servername.value;
}

Here the code i used to read string and convert it as xml :

WWW PlayerInfoUrl = new WWW("http://poker.hesahost.com/fb_helpers/get_servers_virtual.php");
yield return PlayerInfoUrl;
XmlReader xmlReader = new XmlTextReader(new StringReader(PlayerInfoUrl.text));

Thanks for your help ! :stuck_out_tongue:

EDIT : I want to make a datagrid too, like show colloms like : servername, server id
and show row with the value , and the player can click on colloms cell to order by …

First of all really good question.

And you where trying to use , xmlTextReader, which is a stream based class, what actually you should be doing is use a class that accepts a text input as xml not a file, XmlDocument is what i know.There might be other classes also, im not sure.

the below is the sample code i have check and can assure tht it works

 WWW PlayerInfoUrl;
 XmlDocument _doc;
bool lol=false;

// Use this for initialization
void Start () {
	
	PlayerInfoUrl = new WWW("http://poker.hesahost.com/fb_helpers/get_servers_virtual.php");
	
}

// Update is called once per frame
void Update () {

	
	if(PlayerInfoUrl.isDone && !lol)
	{
		_doc= new XmlDocument();
		_doc.LoadXml(PlayerInfoUrl.text);
		print (PlayerInfoUrl.text);
		lol=true;
	}
	
}

PS: XmlDocument class works on android and iphone also…

More info: to display it like a list of servers, first you have to decode the xml and get a string list for that look into xmlNodeList
the snippet for fetching is

XmlNodeList _list = _doc.SelectNodes("servers/server");

after fetching and saving it in a global variable display it from on gui. I hope this is clear??!

		foreach(XmlNode _node in _list)
		{
			if(GUILayout.Button(_node.Attributes.GetNamedItem("myAttribute").Value))
			{
				//join the server
			}
		}