c# 4.0 - How to retrieve specific value from XML document in Windows Phone -
How to get the specified value from XML documents Here is my XML document
How do I get the "Name" node value that is "ABC"?
you XDocument / XElement
var doc = XDocument.Parse ( @ "& Lt ;? xml version =" "1.0" "encoding =" "UTF-8");?;? Root = gt; & lt; line & gt; & lt; id & gt; 22608 gt; & lt; name & gt; ABC & lt; / name & gt; & lt; / line> & lt; root & gt; "); Var name element = doc.Root.Element ("line"). Element ("name"); As a side note, you should stay in the Naming convention. Either start all the elements with a single letter or use all lower letters, but I recommend not mixing them according to your example. If you have a naming convention then you only have to remember the name of the element and Not even the cover. Since the name is not checked until the time of continuous naming convention, you will be saving a lot of debugging for a long time
Comments
Post a Comment