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

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

Rooted Path Expressions

I will use the term
rooted path expression
to mean a path expression that starts with
/
or
//
. In XPath 1.0 these were called absolute path expressions; there is no specific name for them in the 2.0 specification, but I have avoided the word
absolute
because it conceals the fact that the value of these expressions does, in fact, depend on the context node.

The full syntax for path expressions is shown below. We already saw the production
RelativePathExpr
at the beginning of this chapter.

Syntax

Expression
Syntax
PathExpr
(
/
RelativePathExpr?) | (
//
RelativePathExpr) | RelativePathExpr
RelativePathExpr
StepExpr ( (
/
|
//
) StepExpr )*

This production indicates that there are four forms a path expression can take, namely:

  • /
    (a
    root expression
    , already discussed on page 623)
  • /
    RelativePathExpr
    (the subject of this section)
  • //
    RelativePathExpr
    (discussed later on page 626)
  • RelativePathExpr
    (a sequence of steps separated by the binary
    /
    operator, which we examined at the start of this chapter)
BOOK: XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition
9.73Mb size Format: txt, pdf, ePub
ads

Other books

Sevin: Lords of Satyr by Elizabeth Amber
Rex Stout - Nero Wolfe by Three at Wolfe's Door
The Skeleton Cupboard by Tanya Byron
Danger in the Dark by Mignon G. Eberhart
The Dom Project by Heloise Belleau, Solace Ames
Fire by Sara B. Elfgren & Mats Strandberg
Blood Orchid by Stuart Woods
Waltzing In Ragtime by Charbonneau, Eileen