Read XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition Online
Authors: Michael Kay
If the
PatternStep
is the first
PatternStep
in a top-level
RelativePathPattern
, then it matches parent- less nodes as if they had a parent. For example, the
PatternStep
child::title
or
title
will match a
PatternStep
schema-attribute (xml:space)
will match an
xml:space
attribute that has no parent element.
The only two axes that are available directly in a pattern are the child and attribute axes. However, testing for the presence of related nodes on a different axis can be done in the predicate of the
PatternStep
. Any expression can be used in the predicate, and so all axes are available. For example:
caption[preceding-sibling::*[1][self::figure]]
matches a
element.
The NameTest
A
NameTest
such as
*
or
prefix:*
is purely testing the name of the node. This works whether or not there is a schema. There are four forms: