XPath Basics

XPath is a language for identifying nodes in an XML document tree. XPath, unlike most of the other work that the W3C has done on XML, is not itself an XML-based language. However, its compact syntax makes it easy to use for things such as Attribute values within languages that are XML based, such as XSLT. XSLT primarily uses XPath in specifying values for the match and select Attributes of various Elements.

One of the fundamental concepts of XPath is the expression. An expression generally evaluates to a specific node or group of nodes (the node-set mentioned earlier) in a document tree. However, it can evaluate to other things as we'll see later in this chapter.

The form of XPath expression most commonly used in XSLT is known as ...

Get Using XML with Legacy Business Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.