XPointer Function Extensions to XPath

The function library defined in the XPath specification is available to XPointer processors. Several additional XPointer functions are also available.

Location Set Functions

XPointer adds point and range to the node of XPath, as explained earlier in the chapter. Because XPath lacks functions to operate on locations other than nodes, additional functions are required in XPointer to allow manipulation of non-node locations.

The range-to() Function

The range-to() function takes a single location-set argument and returns a range for each member of the location-set argument.

Suppose we had a document that included the fragment shown here:

 <paragraph id="para1" number="1"> <!-- Some content goes here --> </paragraph> ...

Get Special Edition Using XML, Second Edition 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.