<item>
<title>Aerie Peak</title>
<link>http://www.wow-europe.com/realmstatus/index.html#Aerie Peak</link>
<description>Aerie Peak - Realm Down - Lang en - Type PvE</description>
<category domain="status">Realm Down</category>
<category domain="language">en</category>
<category domain="type">PvE</category>
<category domain="queue">false</category>
<guid isPermaLink='false'>EU5-REALM15</guid>
</item>
I need to select title and status. Here's what I came up with:
string uri;
uri = "http://www.wow-europe.com/realmstatus/index.xml";
XmlDocument doc = new XmlDocument();
doc.Load(uri);
XmlNodeList nodes = doc.SelectNodes("//item");
foreach (XmlNode node in nodes)
{
{
RealmList.Text += node["title"].InnerText + " - " + node.SelectNodes("category[@domain='status']")[0].InnerText;
}
}
That gives "System.NullReferenceException: Object reference not set to an instance of an object." at the selection line, though. I'm not sure how would I go about selecting the node.