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

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

Syntax

Expression
Syntax
AbbrevForwardStep
@
? NodeTest
AbbrevReverseStep
..

This syntax describes three abbreviations for axis steps: the defaulted child axis, the use of
@
to represent the attribute axis, and the use of
..
to represent the parent axis. We will consider these in the next three sections; we will then examine the freestanding
/
expression and see that it can be treated as an abbreviation for a more complex expression involving axis steps.

Note that because of the way these constructs are used in the definition of an axis step, any of them can be followed by predicates in square brackets.

Defaulting the Axis Name in a Step

A full step is written in the form:

axis-name :: NodeTest Predicates?

Since the most common axis is the child axis, it is possible to omit the
child::
part and write the step in the abbreviated form:

NodeTest Predicates?

For example, the path expression
employee/name/first-name
consists of three steps, each of which has been abbreviated in this way. It is short for
child::employee/child::name/child::first-name
.

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

Other books

My Life as a Cartoonist by Janet Tashjian
Scars by Cheryl Rainfield
Tales From the Clarke by John Scalzi
Pteranodon Mall by Ian Woodhead
Lovely in Her Bones by Sharyn McCrumb
Faithful Heart by Al Lacy