The following bulleted lists give you a sampling of the various relative and absolute location paths Ive talked about in this chapter.
-
chapter or child::chapter selects the chapter element children of the current node.
-
@ name or attribute::name selects all the name attributes of the current node.
-
.. or parent::node() selects the parent of the current node.
-
. or self::node() selects the current node, regardless of its type.
-
self::chapter selects the current node if it is a chapter element.
-
decendant::chapter selects all the chapter descendants of the current node.
-
descendant-or-self::page selects all the page element descendants of the current node and, if the current node is a page element, then include it as well.
-
ancestor ::page selects all the page element ancestors of the current node.
-
ancestor-or-self::page selects all the page element ancestors of the current node and, if the current node is a page element, then include it as well.
-
chapter/descendant::page selects the page descendants of the chapter element children of the current node.
-
chapter[1] or chapter[position()=1] selects the first chapter element child of the current node.
-
chapter[last()] selects the last chapter element child of the current node.
-
U following-sibling::chapter[1] selects the next chapter element sibling of the current node.
-
preceding -sibling::chapter[1] selects the previous chapter element sibling of the current node.
-
chapter[@level] selects all the chapter element children of the current node that have a level attribute defined.
-
chapter[not(@level)] selects all the chapter element children of the current node that dont have a level attribute defined.
-
chapter[@level='advanced'] selects all the chapter element children of the current node that have a level attribute with a value of advanced .
-
chapter[summary] selects all the chapter element children of the current node that have one or more summary element children.
-
chapter[2][@level] selects the second chapter element child of the current node if it has a level attribute defined.
-
chapter[@level][2] selects the second chapter element child of the current node that has a level attribute defined.