This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Grouping in the FAQ (was Re: Conflicting Node Values)
- To: xsl-list at mulberrytech dot com
- Subject: Re: Grouping in the FAQ (was Re: Conflicting Node Values)
- From: David Carlisle <davidc at nag dot co dot uk>
- Date: Fri, 26 May 2000 12:24:08 +0100 (BST)
- References: <93CB64052F94D211BC5D0010A800133101FDED82@wwmess3.bra01.icl.co.uk>
- Reply-To: xsl-list at mulberrytech dot com
I wrote
> Don't you want
>
> count(.|key('tid',.)[1])=1
>
> which is equivalent to the generate-id tests.
Of course, it's only equivalent in the case that you know that the
key returns something, otherwise if the key returns the empty set then
the above will always be true as .|key('tid',.)[1] will be .
In general the test
"is the current node the first node in the node set x"
is either
"generate-id(.) = generate-id($x[1])" (the [1] is optional here)
or
"count(.|$x[1])=count($x[1])"
or
"$x and count(.|$x[1])= 1"
David
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list