Subject: Re: [xsl] Re: Re: Re: Re: order of UNIONs From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx> Date: Fri, 16 Nov 2001 13:17:33 +0000 |
Hi David, >> <xsl:variable name="nodeSet" >> select="$nodeSequence | $nodeSequence" /> > > It's not just union ( | ) that has different semantics for lists. As far as I can see in the public F&O WD, the only change to the semantics of 'union' for XPath 2.0 is that it returns a node sequence in document order rather than a node set with no order. I don't think that its the 'ordering' of sequences that are the potential/perceived problem, but rather the duplication of nodes within the sequence. So in practical terms I don't think that the use of union in XPath 1.0 and XPath 2.0 is all that different, is it? The only slight peculiarity is that you could easily get a union that contained fewer nodes than either of the two sequences you were unioning. > what would you guess > select="count(*/..)" > should be, given any semantics that you want to guess for sequences and > for / (and for count() ) > > In XPath 1.0, 'cause sets are sets, you get the answer 1. I think that you're implying that somewhere along the design path, someone might have suggested that the semantics of / should be such that */.. returned a node sequence containing N of the current node, where N is the number of element children of the current node. But my guess is that any location path that's valid in XPath 1.0 will always return a node sequence that doesn't contain duplicates, in document order (and this guess was confirmed by Mike yesterday). Thus */.. will return a node sequence containing a single node, so you get the answer 1, as you did in XPath 1.0. I feel like I'm missing something. Cheers, Jeni --- Jeni Tennison http://www.jenitennison.com/ XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Re: Re: Re: Re: order of , David Carlisle | Thread | Re: [xsl] Re: Re: Re: Re: order of , David Carlisle |
Re: [xsl] xml 2 csv, Eric Vitiello | Date | RE: [xsl] xml 2 csv, Jan Weiss |
Month |