The preceding-sibling Axis

The preceding-sibling axis selects elements that precede the context node in the same parent element. For example, /descendant::BORN[position()=2]/preceding-sibling::*[position()=1] selects Elodie Bellau's NAME element, <NAME>Elodie Bellau</NAME>. /descendant::BORN[position()=2]/preceding- sibling::*[position()=2] doesn’t point to anything because there's only one sibling of Elodie Bellau's BORN element before it. There's no abbreviation for the preceding-sibling axis.

Previous | Next | Top | Cafe con Leche

Copyright 1999, 2000 Elliotte Rusty Harold
Last Modified February 1, 2000