XPath Data Types

There are four XPath data types, not just the node set type that match patterns must return:

  • Node sets

  • Booleans

  • Numbers

  • Strings

Result Tree Fragments

XSLT 1.0 also added result tree fragments to the XPath data types. As mentioned in Chapter 4, result tree fragments were just tree fragments that you could assign to XSLT variables. Support for them was removed in the XSLT 1.1 working draft, which means they probably won’t be a part of XSLT 2.0. You can treat result tree fragments as data types by using <xsl:variable>, which we’ll see in Chapter 9.

The following sections look at these various types in turn.

XPath Node Sets

As its name implies, a node set is simply a set of nodes. A node set may include a number of nodes, a single ...

Get Inside 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.