c# - How to get handle to a specific XElement -


consider have following xml structure:

<root>   <file> a.txt        <version> 1.5 </version>   </file>    <file> b.txt        <version> 1.0 </version>   </file> </root> 

how can handle xelement: <version> 1.0 </version> search? know can search tag function xelement.element(xname) not me.

do want list of version's..here is!

xdocument doc=xdocument.load(yourxml); list<string> lst=doc.descendants()                     .elements("version")                     .select(x=>x.value).tolist(); 

Comments

Popular posts from this blog

.htaccess - First slash is removed after domain when entering a webpage in the browser -

Socket.connect doesn't throw exception in Android -

SPSS keyboard combination alters encoding -