|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Grouping in the FAQ (was Re: Conflicting Node Values)
> Steve Muench writes:
> > At least for the Oracle XSLT engine the:
> >
> > generate-id(.) = generate-id(key('tid',.)[1])
> >
> > is slightly faster because it doesn't have to produce
> > two nodesets to merge and count as does the:
> >
> > count(.|key('tid',.))=1
> >
> > approach. The latter is definitely shorter and the
>
> Thats very interesting. Maybe I misinterpret Mike as saying it was
> faster.
I did say the "union" approach might be marginally faster on Saxon, on
thinking about it again I'm not so sure. I didn't spot that the
generate-id() approach would only look at the first node in the result of
key() whereas the union approach looks at all of them. Would need to measure
to be sure.
If people are going to start using generate-id() like this, though, I ought
to think about speeding it up (if possible, without bloating the tree!)
I'm a bit confused as
generate-id(.) = generate-id(key('tid',.)[1])
tests if the current node is the first node returned by the yey
and
generate-id(.) = generate-id(key('tid',.))
is the same due to `take first node in node set'
semantics
but
count(.|key('tid',.))=1
tests that the key only returns one node, and that that is the current
one.
Don't you want
count(.|key('tid',.)[1])=1
which is equivalent to the generate-id tests.
David
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








