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

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

In XPath 2.0, if you want to remove duplicates from a sequence of nodes
$seq
, and sort them into document order, you can write
$seq/.
, or equivalently,
./$seq
. The sorting and deduplication is part of the defined behavior of the
/
operator.

Function Calls

A
FunctionCall
invokes a function. This may be one of the system-defined functions described in Chapter 13, or it may be a vendor- or user-supplied function.

Each built-in or user-defined atomic type also has a corresponding constructor function available for constructing values of that type (for example,
xs:date(‘2008-02-29’)
constructs a date).

There may also be additional functions described in a host language in which XPath is embedded—for example, the XForms standard defines a number of additional XPath functions. Some of these duplicate functionality that is now in the standard XPath 2.0 library, but others define functionality specific to the XForms environment; for example, the
instance()
function, which provides access to an XML document that holds the data collected using an interactive form.

Expression
Syntax
FunctionCall
QName
(
( ExprSingle (
,
ExprSingle)* )?
)
ExprSingle
ForExpr |
QuantifiedExpr |
IfExpr |
OrExpr

Other books

Guilty Passion by Bright, Laurey;
Marrying Mike...Again by Alicia Scott
The Sound and the Furry by Spencer Quinn
Chief Distraction by Kelly, Stella
A Mask for the Toff by John Creasey
Grey Area by Will Self
Artifacts by Pete Catalano