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

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

In patterns, the
|
operator can be used only at the top level. XPath 2.0 allows expressions such as
(chap|appendix)/title
, but this is not a valid pattern. The required effect can be achieved by writing
chap/title|appendix/title
or, if you prefer,
title[parent::chap|parent:: appendix]
.

Examples

Construct
Meaning
TITLE
TITLE
is a
PathPattern
, so it is also a
Pattern
.
preface|chapter| appendix
A node matches this pattern if it is a

element, a

element, or an

element.
/|*
A node matches this pattern if it is either a document node or an element node.

PathPattern

A
PathPattern
states conditions that a node must satisfy based on its name, its node kind, its position relative to other nodes, and/or its ID and key values.

This construct is a subset of the
PathExpr
construct in the XPath grammar.

Syntax

Expression
Syntax
PathPattern
RelativePathPattern |
/
RelativePathPattern? |
//
RelativePathPattern |
IdKeyPattern
((
/
|
//
)RelativePathPattern) ?
BOOK: XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition
2.76Mb size Format: txt, pdf, ePub
ads

Other books

A Chorus of Innocents by P F Chisholm
King Solomon's Mines by H. Rider Haggard
Their Wicked Ways by Julia Keaton
El percherón mortal by John Franklin Bardin
Twenty Twelve by Helen Black
Snowed Under by Celeste Rupert
AnyasDragons by Gabriella Bradley
Innocents by Cathy Coote