I am trying to pull the <thumbnail_large>http://b.vimeocdn.com/ts/235/662/23566238_640.jpg</thumbnail_large> value from the thumbnail_large element in a created xml file. Is there a way to pull that value without looping through the who xml file? Thanks for any help.
<videos>
<video>
<id>6271487</id>
<title>Spheres</title>
<description>text</description>
<url>http://vimeo.com/6271487</url>
<thumbnail_small>http://b.vimeocdn.com/ts/235/662/23566238_100.jpg</thumbnail_small>
<thumbnail_medium>http://b.vimeocdn.com/ts/235/662/23566238_200.jpg</thumbnail_medium>
<thumbnail_large>http://b.vimeocdn.com/ts/235/662/23566238_640.jpg</thumbnail_large>
<embed_privacy>anywhere</embed_privacy>
</video>
</videos>
Yes, there is and it is called XPath. Try this:
XmlDocument doc = new XmlDocument();
doc.Load(@"/path/to/file");
XmlNode node = doc.SelectSingleNode("/videos/video/thumbnail_large");
string URI = node.InnerText;
At least that is what I can read from this poorly formatted file. If you are using two different alphabets (video details and HTML markup) you should consider using namespaces.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With