Chapter 15. XPath 2.0

XPath (XML Path Language) is a language for selecting and processing parts of an XML document. XPath 2.0 is part of the eight W3C Recommendations published together in January 2007, and includes significant changes to the original version published in 1999.

One fundamental change is in the data model used by XPath. In version 1.0, the data model used is based on node sets (see Chapter 3). In version 2.0, the data model is based on sequences. A sequence is a collection of items (nodes and/or values), whereas a node set is a collection of nodes only. This distinction, while subtle, is an important enhancement to XPath 2.0 that I’ll discuss more in this chapter.

In addition to a new data model, XPath 2.0 has a larger set of functions; ...

Get XML: Visual QuickStart Guide, Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.