Complex location paths

Apart from the selection of children, it has already been shown that parents and further ancestors of the current element can also be selected. But there are many other options available, and each can be thought of as a direction, or an ' axis'. A particular axis is indicated using an 'axis specifier'. One axis specifier has already been seen; the 'child::' axis specifier selects the child axis.

Close family

Parents, children and siblings can be selected using the 'parent::', 'child::', 'preceding-sibling::' and 'following-sibling::' axis specifiers:

The ' parent::' prefix, along with the 'node()' function, is equivalent ...

Get XML Companion, The, Third Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.