O'Reilly logo

Special Edition Using XML, Second Edition by - et al. David Gulbransen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

XPath Functions

Version 1 of the XPath Recommendation provides a Core Function Library. The various functions provided in that library are described in this section.

XPath functions can return a data type that is one of the four XPath data types—node-set, boolean, string, or number.

Context Functions

Context functions say something specifically about the current context or in relation to the current context as a starting point.

The last() Function

The last() function is typically used in a predicate within a location path. It selects the last node in the current node list.

<Result> 
<First>John Doe</First>
<Second>Jane Doe</Second>
<Third>Robert Kennedy</Third>
</Result>

If the result element node was the context node and the path expression ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required