Introduction to the XPath Tree Model

MSXML 5.0 SDK

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

Introduction to the XPath Tree Model

XPath treats an XML document as a tree of interrelated branches and nodes. A node can be any of the following types of nodes used in any XML document:

Additionally, the document itself is also considered a type of node. The XPath tree model is based not on the nodes alone, but on their relationship to one another. For example, how elements relate to one another, attributes to elements, and so on.

The concept of a node is important. XPath—and by extension, XSLT—does not provide direct access to tags, attributes, and other markup. It provides access to the logical nodes established by that markup.

XPath's view of this sample document is explored in the following topics, which are contained in this section:

The topics in this section use this XML file: Sample XML File for XPath Tree Model