Probably the function most frequently used in XPointer predicates is position(). This returns the index of the node in the context node list. This allows you to find the first, second, third, or other indexed node. You can compare positions using the various relational operators like <, >, =, !=, >=, and <=.

For instance, in the family tree document, the root element is FAMILYTREE element is the root. It has 14 immediate children, 12 PERSON elements, and two FAMILY elements. In order, they are:


Previous | Next | Top | Cafe con Leche

Copyright 1999 Elliotte Rusty Harold
Last Modified August 20, 1999