This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Sequences: how to get them (eg in Saxon)?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]