Currently I am able to select attributes in an XML document because they are uniquely identifiable, like this:
XmlDocument weatherData = new XmlDocument();
weatherData.Load(query);
XmlNode channel = weatherData.SelectSingleNode("rss").SelectSingleNode("channel");
XmlNamespaceManager man = new XmlNamespaceManager(weatherData.NameTable);
man.AddNamespace("yweather", "http://xml.weather.yahoo.com/ns/rss/1.0");
town = channel.SelectSingleNode("yweather:location", man).Attributes["city"].Value;
But how do I select the "text" attribute from a node of the same name (yweather:forecast)?
<yweather:forecast day="Sat" text="Sunny" code="32"/>
<yweather:forecast day="Sun" text="Partly Cloudy" code="30"/>
<yweather:forecast day="Mon" text="AM Showers" code="39"/>
<yweather:forecast day="Tue" text="Cloudy" code="26"/>
<yweather:forecast day="Wed" text="Cloudy/Wind" code="24"/>
Is there a conditional statement I can use to only select the text attribute where the day attribute is equal to "Mon"?
"yweather:location[@day = 'mon']/@city"