XPath Functions

The examples in the previous section illustrated the basics of building predicate expressions as part of a location step. In order to build more advanced XPath expressions, one must take advantage of the XPath function library. XPath defines several types of functions that may be used within location paths (mostly within predicates) that are required to build more advanced expressions. These functions are divided into the following four groups:

  • Node-set

  • String

  • Boolean

  • Numeric/Mathematic

Of these four groups, the node-set functions are the most commonly used. Each of the functions in the node-set group interacts in some way with a node-set. Table 3.5 contains a list of available node-set functions and their brief descriptions. When ...

Get Essential XML: Beyond Markup 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.