The preceding Axis

The preceding axis selects all elements that occur before the context node. The preceding axis has no respect for hierarchy. The first time it encounters an element's start tag, end tag, or empty tag, it counts that element. For example, consider this rule:

/descendant::BORN[position()=3]/preceding::*[position()=5]

This says go to the third BORN element from the root, Louise Pauline Bellau's birthday, <BORN>29 Oct 1868</BORN>, and then move back five elements. This lands on Maria Bellau's PERSON element. There's no abbreviation for the preceding axis.


Previous | Next | Top | Cafe con Leche

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