Creating Predicates

Predicates are true XPath expressions, and XPath is much more of a true language than patterns; for example, XPath expressions can return not only lists of nodes, but also Boolean, string, and numeric values. XPath expressions are not restricted to working with the current node or child nodes, because you can work with parent nodes, ancestor nodes, and more.

Chapter 7 gives its full attention to XPath, but it’s worth getting an introduction to the subject during this discussion about patterns, because the predicate part of a pattern is its most powerful part. There are all kinds of expressions that you can work with in predicates; the following list includes some possible types, which are explored in the next sections:

Get Inside XSLT now with O’Reilly online learning.

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