Re: [xsl] Re: Re: Re: Re: order of UNIONs

Subject: Re: [xsl] Re: Re: Re: Re: order of UNIONs
From: David Carlisle <davidc@xxxxxxxxx>
Date: Fri, 16 Nov 2001 13:55:27 GMT
> But my guess is that any location path that's valid in XPath 1.0 will

I hope so:-) but that (I think) is partly Dimitre's point. You can of course
declare that anything works any way you want (and for compatibility
reasons, you should)

but the fact that, over an ordered domain (as the set of nodes are in
Xpath), sets are isomorphic to duplicate free, ordered lists, does not
mean that the natural operations on sets are necessarily the same as the
natural operations on lists.

the natural function to apply to lists is "map" which takes a list of X
and a function from X to Y and produces a list of Y by applying the
function to each elemnt in the list. This naturally produces a list of
equal length to what you started with. So to remain isomorphic to the
set operations you start to add duplicate removal and re-ordering
semantics to the operators, which is fine, but then you realise why you
wanted to have sequences in the first place was to handle sequences that
might contain duplicates and might not have any notion of document order
(simple values, for instance). Again it's always possible to specify
something but not necessarily easy to make everything work in a natural

The main use case for sequences (as stated in the requirents doc) is for
schema list types, ie lists of simple values. Simple values don't have
identity (any integer 3 is the same as any other one)  Node sets in
xpath are sets over node-identity (a function, somewhat strangely not
actually available in xpath 1) rather than node value. You can have two
nodes in a node set with the same value, they just can't be the same
node. Thus merging these two things (and the operations on them) isn't
as simple as you seem to suggest. (But it's not my problem as I'm not in
the WG:-)


This message has been checked for all known viruses by Star Internet
delivered through the MessageLabs Virus Scanning Service. For further
information visit or alternatively call
Star Internet for details on the Virus Scanning Service.

 XSL-List info and archive:

Current Thread