XPath Nodes Example

MSXML 5.0 SDK

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

XPath Nodes Example

To help illustrate the nodes used by the XML Path Language (XPath), the following graphic represents the source tree for the first <book> element in the XML Document Map.

This source tree represents the nodes that are accessible using XSLT. If you compare the source file to the source tree represented here, you will see that not all of the objects within the document appear in this source tree. For example, the source tree does not have nodes for the <?xml-stylesheet type="text/xsl" href="show_books.xsl"?> and <!DOCTYPE catalog SYSTEM "catalog.dtd"> elements that appear in the document prolog. These missing objects still exist in the DOM. You can access them programmatically, although you cannot access them directly using XPath and, by extension, XSLT.

Note   Although information in the prolog of a document is not typically accessible, XPath and XSLT are able to access it because the document has been fully parsed by the time the XSLT processor accesses the document tree.

For information about the name and string values associated with the nodes in the previous graphic, see XPath Node Names and String Values. For information about character references (such as $#x47; and &amp;), see Character and Entity References.

See Also

Working with a Source Tree | Using XPath to Select Nodes | The XSLT Processor