Read from xml
-
Hi, how can I access a specific node in a XML document and read its data? Say for example if I have the following XML doc and want to access on Note id; title date text title date text /Thanks
You would most likely want to learn XPath. You can do it without by walking the DOM, but XPath is worth the time it takes to learn it (well, unless you go firectly for some LINQ stuff). In the simple form, load it into an XmlDocument, then use the SelectNodes/SelectSingleNodes methods available on the document (and all contained elements). Google for "XPath Tutorial" to figure out how XPath works.
-
You would most likely want to learn XPath. You can do it without by walking the DOM, but XPath is worth the time it takes to learn it (well, unless you go firectly for some LINQ stuff). In the simple form, load it into an XmlDocument, then use the SelectNodes/SelectSingleNodes methods available on the document (and all contained elements). Google for "XPath Tutorial" to figure out how XPath works.