Subject: RE: Sequences: how to get them (eg in Saxon)?
From: "Evan Lenz" <evan@xxxxxxxxxxxx>
Date: Mon, 29 Apr 2002 15:02:15 -0700
|
Mike Kay wrote:
> Node-sets in XPath 1.0 are replaced by node sequences; the difference is
> that a node sequence may be in any order, not necessarily document order.
Another significant difference to note is that sequences, unlike node-sets,
can contain the same node more than once.
The following expression returns one bar element and one foo element in a
document-order sequence (as with XPath 1.0, duplicates are removed):
(bar[1] | foo[1] | bar[1])
However, the following expression (using the new comma operator) returns a
sequence of the bar element followed by the foo element followed by the same
bar element again, in that order (regardless of their relative document
order):
(bar[1], foo[1], bar[1])
Hopefully, these examples clearly illustrate this characteristic of
sequences (if not its usefulness (and it is useful)).
Evan
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|