5.2. The Node-set Core Function Group

There are seven node-set functions. Each of these operates upon the current node-set at the given stage in the evaluation of the expression in which the function is called. Our <year> example is duplicated for convenience in Example 5-1.

Consider the expression count(//harvest//month). In this expression, harvest is the ancestor node from which descendant month elements are to be counted. Notice how we have used a pattern expression comprising the argument to count() function. This is because count() is a node-set function, expecting a node-set as an argument, and pattern expressions return node-sets. The node-set acted upon in this example is the set of <month> elements descended from <harvest>. Because ...

Get XSLT and XPATH: A Guide to XML Transformations 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.