The XPath language is used to describe locations in a document tree. It is the expression language used by XSLT. See the XPath specification for complete details.
A well-formed XML document can be visualized as a tree (in the
computer science meaning of the term), and this view is used
throughout XPath and XSLT. For example, if a certain document
represents a book, it might have a top-level tag
book, containing elements like
A few important definitions:
A node is the basic building block of the document tree, that is, the data structure used to represent an XML document during its processing by an XSLT script.
The node representing the outermost tag of the document is called the root node of the tree.
All nodes except the root node of the tree have a parent node, and many nodes can have child nodes under them.
To continue the example above, the
book node is the root,
and its children are the