At the most obvious structural level, the tree which XPath can wander through the Sample XML File for XPath Tree Model consists of the document prologthe XML declaration, the document-type declaration, and the <?xml-stylesheet?>
processing instructionthe root element <books>
, and the comment which follows the root element's end tag.
Schematically, this tree might be represented like this:
Each of these containers is referred to in XPath terms as a node, and a collection of nodes as a node-set. In the above figure, there are four nodes accessible to most XSLT processors, including the MSXML engine:
<?xml-stylesheet?>
processing-instruction node<books>
element node<books>
elementNote The XML declaration and the document-type declaration are not typically accessible. This is because by the time an XSLT processor gets access to the document tree, the document has been fully parsed; information in the XML and document-type declarations is assumed to be useful to the parser but not passed to a downstream application.
Sample XML File for XPath Tree Model