Sample Tree for the Document Root

MSXML 5.0 SDK

Microsoft XML Core Services (MSXML) 5.0 for Microsoft Office - XPath Developer's Guide

Sample Tree for the Document Root

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 prolog—the XML declaration, the document-type declaration, and the <?xml-stylesheet?> processing instruction—the 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:

  • The document root node
  • The <?xml-stylesheet?> processing-instruction node
  • The <books> element node
  • The comment node following the <books> element
Note   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.

See Also

Sample XML File for XPath Tree Model