.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links


Posted By:      Posted Date: September 13, 2010    Points: 0   Category :ASP.Net
Hi i am using a rss feed from utube but i am not sure how to get 1 node out.I have the following code below XPathNodeIterator xPathIt = p_xPathNav.Select("//item");</p><p>while (xPathIt.MoveNext()){ tempLink = xPathIt.Current.SelectSingleNode("media:thumbnail").Value }</p><p>i need the first occurance of media:thumbnail, the xml is below</p><p>&lt;item&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;guid isPermaLink="false"&gt;http://gdata.youtube.com/feeds/api/videos/qrO4YZeyl0I&lt;/guid&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;pubDate&gt;Tue, 24 Nov 2009 07:45:26 +0000&lt;/pubDate&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;atom:updated&gt;2010-09-10T16:01:39.000Z&lt;/atom:updated&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;app:control&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;yt:state name="restricted" reasonCode="limitedSyndication"&gt;Syndication of this video was restricted by its owner.&lt;/yt:state&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/app:control&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;category domain="http://schemas.google.com/g/2005#kind"&gt;http://gd

View Complete Post

More Related Resource Links

Loop through nodes of XPathNodeIterator variable



I have the following code which returns an XML feed of tag information from Umbraco CMS (with a simple schema <tags><tag>Tag1</tag><tag>Tag2</tag> etc...</tags>).

XPathNodeIterator tags = umbraco.editorControls.tags.library.getAllTagsInGroup("document downloads");
			//string tagType = tags.GetType().ToString();
			foreach (XPathNavigator tag in tags)
				debugString += tag.ToString() + " <br /> ";

However, when I output the 'debugString' value, it has just returned a single long string of all tags joined together.  I can't seem to get it to iterate through each tag individually.  How do I get it to iterate through just the tag nodes so I can display each tag separated by a line break?

If I output the 'tagType' value I get: 'MS.Internal.Xml.XPath.XPathSelectionIterator'.

ASP.NET 3.5 by the way.

Thanks all!

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend