XPath Data Model
In any computer language for manipulating data, the language defines a particular philosophy for thinking about what the data is. XPath considers data to be the nodes that represent XML documents, plus strings, numbers, and Booleans. The nodes are there to represent the XML document that the XPath expression is examining. Numbers and Booleans were added to make it possible to write complex expressions, such as selecting the fifth <line> within an <address> or the element satisfying the criterion of having both an address element and a name attribute. Likewise, strings are there to allow manipulation and comparison of the content of elements and attributes.
The Seven Node Types
As mentioned in Chapter 2, when a document is parsed, ...
Get Special Edition Using XSLT 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.