Click here to Skip to main content
15,914,016 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i do youtube request and i get the xml stream result i pass the "streamResult"
to "Xdocument" , I managed to take all the parameters with the name spance like this :

durations = doc.Descendants(xmlNameSpace + "content").......

but the "published" element value i cant take this is the xml:

<feed xmlns="http://www.w3.org/2005/Atom".......>
  <id>http://gdata.youtube.com/feeds/api/videos</id> 
  <updated>2014-07-15T11:19:24.176Z</updated> 
  <category scheme="http://schemas.google.com/g/2005#kind">
  <link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://gdata.youtube.com/feeds/api/videos" /> 
- <author>
  <name>YouTube</name> 
  <uri>http://www.youtube.com/</uri> 
  </author>
  <generator version="2.1" uri="http://gdata.youtube.com">YouTube data API</generator> 
  <openSearch:totalResults>125170</openSearch:totalResults> 
  <openSearch:startIndex>1</openSearch:startIndex> 
  <openSearch:itemsPerPage>25</openSearch:itemsPerPage> 
- <entry>
  <id>http://gdata.youtube.com/feeds/api/videos/GIk6kSdeIsA</id> 
  <published>2011-09-21T10:31:53.000Z</published> 
  <updated>2014-07-14T23:05:54.000Z</updated> 
  .....<entry>


i tray this code maby:
List<XElement> node = doc.Root.Descendants("entry").ToList();


please helppp :)
Posted

1 solution

Hi,

Kindly review below link, which may help you to understand reading and writing XML with C#.
How to: Parse XML with XmlReader[^]
C# XmlReader[^]
How to open and read XML file in C#[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900