Is there a simple way of moving back to the root node within any given context. The XML document I'm working with is extremely large and would require using ../.. about a dozen times!!
Any help is greatly appreciated guys.
The key part of this XPath is *[1] , which will select the node value of the first child of Department .
XPath uses path expressions to select nodes or node-sets in an XML document. The node is selected by following a path or steps.
An XPath expression starting with /
is always referring to the root element. Look here for the syntax and some useful sample queries
If you want to select the root element itself, simply use /<element name>
or /*
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With