Range Expressions

To specify a range you separate the starting and ending locations paths with the keyword to. The first path 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 Listing 17-1. This XPointer accomplishes that:

xpointer(/child::PERSON[position()=1] to /child::PERSON[position()=last()])


Previous | Next | Top | Cafe con Leche

Copyright 1999, 2000 Elliotte Rusty Harold
elharo@metalab.unc.edu
Last Modified February 1, 2000