Altova Mailing List Archives>Archive Index >xsl-list Archive Home >Recent entries >Thread Prev - Re: [xsl] Benefits of using xsl:key [Thread Next] Re: [xsl] Benefits of using xsl:keyTo: xsl-list@-----.------------.--- Date: 11/3/2009 9:21:00 AM 2009/11/3 Jesper Tverskov <jesper.tverskov@g...>: > On Tue, Nov 3, 2009 at 9:03 AM, David Carlisle <davidc@n...> wrote: >>However a typical >> muenchian grouping example can easily be orders of magnitude faster and >> so measurable on really quite small documents as you are avoiding >> an order n^2 along the sibling axis looking for duplicates. > > What about XSLT 2.0 then, where we use xsl:for-each-group? > > A set of XSLT 2.0 test files demonstrating a dramatic difference would > really be much appreciated? Create a large index file along the lines of: <entry id="nnn1" value="vvv1"/> <entry id="nnn2" value="vvv2"/> then in another stylesheet do multiple lookups into that file: $entry-doc//entry[@id eq $id]/@value then use a key instead: <xsl:key name="entry-by-id" match="entry" use="@id"/> with key('entry-by-id', $id, $entry-doc)/@value Provided the processor doesn't optimize // (such as the paid-for version of Saxon) then you should see a measurable difference between the former and the latter. -- Andrew Welch http://andrewjwelch.com Kernow: http://kernowforsaxon.sf.net/ --~------------------------------------------------------------------ XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/ or e-mail: <mailto:xsl-list-unsubscribe@l...> --~-- | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
