Read XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition Online
Authors: Michael Kay
Examples
Construct | Meaning |
title | This is a PatternStep , and therefore the simplest form of RelativePathPattern . It selects any |
section/title | This is a RelativePathPattern consisting of two PatternSteps joined by the / (is-parent-of) operator. It matches a |
chapter//footnote | This is a RelativePathPattern consisting of two PatternSteps joined by the // (is-ancestor-of) operator. It matches a |
chapter/section//footnote | A more complex RelativePathPattern that matches any |
chapter[1]//footnote | This pattern matches every |
PatternStep
A
PatternStep
defines conditions that an individual node must satisfy: typically some combination of the node name, node kind, schema type, and a set of boolean or numeric predicates. The syntax for a
PatternStep
is a subset of the syntax for an
AxisStep
in the XPath expression language.
Syntax
Expression | Syntax |
PatternStep | PatternAxis? NodeTest Predicates |
PatternAxis | child :: | attribute :: | @ |
NodeTest | NameTest | KindTest |
NameTest | QName | * | NCName :* | *: NCName |