RE: Nested sequences in XPath

> > If we do ever want to add nested sequences, I don't think it's 
> > difficult; we would just add a new kind of item called a 
> > sequence-reference.
> 
> And what would this expression mean in this hypothetical XPath 3:
> 
> (a, (b, c), d, (e, f))
> 

It would mean the same as it means in XPath 2. If we provided a new kind
of item in the type system, we would need to provide new syntax to
support it, for example

  (a, seq-ref(b, c), d, seq-ref(e, f))

But personally, I don't see this happening. The reason that sequences
have been added to XPath is to support list-valued nodes in XML Schema.
I would be greatly surprised if XML Schema is ever enhanced to support
lists-of-lists, and if it isn't, then there is no need for XPath to
support them either.

The idea of sequence flattening in XPath 2.0 is completely consistent
with the way path expressions work in XPath 1.0, where the construct
a/b/c gives a flat node-set rather than a set of sets of sets.

Michael Kay 

Received on Wednesday, 9 April 2003 15:58:30 UTC