XPath Umbound
November 10, 2007 7:07 AM
Subscribe
Coding help on XPath queries in WPF (I wanted to post this in the msdn forums, but they don't seem to be responding right now)
I have a WPF user control bound to an rss feed. The feed, in part, looks like this (irrelevant stuff replaced with "..."):
<rss ...>
<channel>
...
<yweather:units temperature="F" distance="mi" pressure="in" speed="mph" />
<:yweather:wind chill="61" direction="0" speed="0" />
...
</channel>
</rss>
So based on this data, I would say that the wind speed is 0 mph (the @speed attribute of yweather:wind plus the speed attribute of yweather:units);
I have two TextBlock elements, one of which I need to bind to the yweather:wind @speed attribute and the other to the yweather:units @speed attribute.
binding to XPath=//@speed[1] returns the expected value of "mph". Binding to XPath=//@speed[2] returns nothing. Binding to XPath=//@speed[last()] returns "mph". This tells me that the second @speed attribute is not being seen.
Can anyone point me in the right direction on how to bind to that second attribute?
posted by Lokheed to computers & internet (7 comments total)
<yweather:units temperature="F" distance="mi" pressure="in" speed="mph" height="feet"/>
<:yweather:wave height="6" direction="45" speed="3" />
<:yweather:wind chill="61" direction="0" speed="0" />
posted by orthogonality at 7:15 AM on November 10, 2007