XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition (380 page)

BOOK: XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition
7.25Mb size Format: txt, pdf, ePub
ads

Syntax

Expression
Syntax
RelativePathExpr
StepExpr ( (
/
|
//
) StepExpr )*
StepExpr
AxisStep
|
FilterExpr

We will come back to the pseudo-operator
//
later in the the chapter; for the moment, we will discuss the meaning of
/
. Moreover, we will confine ourselves for the moment to the case where the expression on the right hand side of
/
selects nodes (we will see in Chapter 10 that the operator can also be overloaded to select atomic values). Understanding this operator is the key to understanding path expressions.

An arithmetic expression such as
A+B+C
can be decomposed into the form
(A+B)+C)
, and defined in terms of a binary
+
operator that takes two operands. Similarly, a path expression of the form
A/B/C
can be decomposed into
(A/B)/C)
, which means that the result of a path expression is defined entirely in terms of the meaning of the binary
/
operator. There is a difference, however: The
/
operator is a higher-order operator, because the expression used as its right-hand operand is evaluated repeatedly, once for every item in the sequence selected by the first operand.

BOOK: XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition
7.25Mb size Format: txt, pdf, ePub
ads

Other books

The Butterfly in Amber by Kate Forsyth
The Rogue by Sandy Blair
Girl in Shades by Allison Baggio
Rescue Island by Stone Marshall
FROST CHILD (Rebel Angels) by Philip, Gillian