The descendant
axis searches through all the
descendants of the context node, not just the immediate
children. For example,
/descendant::BORN[position()=3]
selects the third
BORN
element encountered in a depth-first search of
the document tree. (Depth first is the order you get if you
simply read through the XML document from top to bottom.) In
Listing 17-1, that selects Louise Pauline Bellau's birthday,
<BORN>29 Oct 1868</BORN>
.
The descendant axis can be abbreviated by using a double
slash in place of a single slash. For example,
//BORN[position()=3]
also selects the third
BORN
element encountered in a depth-first search of
the document tree. //NAME
selects all
NAME
elements in the document.
//PERSON/NAME
selects all NAME
children of PERSON
elements.