XPath Core Function Library

Node-Set Functions

last()

According to the XPath specification, the last() function is a node-set function that returns the size for the current (context) node. In reality, this function selects the last child node of the context node.

Arguments: None

Return Type: Number

Example:

child::para[position()=last()] 
position()

The position function is a node-set function that returns the position for the current (context) node.

Arguments: None

Return Type: Number

Example:

child::para[position()=last()] 
count(node-set)

Takes a node set and returns the number of nodes in the set.

Arguments: node-set

Return Type: Number

Example:

child::para[count()] 
id(string)

Selects one or more element instances based on its ID ...

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.