In some applications it may be important to specify a range of a document rather than a particular point in a document. This can be accomplished with the range axis. A range begins at one XPointer and continues until another XPointer. A range is indicated by the keyword range used as a location term. However, it is followed by two location terms separated by a comma. The first identifies the start of the range and the second identifies the end of the range.

For example, suppose you want to select everything between the first PERSON element and the last PERSON element in genealogy.xml. This XPointer accomplishes that:

range::/child::PERSON[position() = 1],/child::PERSON[position() = last()]

Previous | Next | Top | Cafe con Leche

Copyright 1999 Elliotte Rusty Harold
Last Modified August 20, 1999