[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: XSLT optimisation

Subject: Re: XSLT optimisation
From: David Carlisle <davidc@xxxxxxxxx>
Date: Fri, 28 Mar 2003 16:36:52 GMT
xslt optimisation
> I realise that both key() and <xsl:copy> are ways of improving
> the speed of processing,

<xsl:copy doesn't really spedd anything, it just generates one node in
the result with the same name as a node ion the source.

<xsl:copy-of can speed things up: If you want to copy an entire branch
copy-of select="." is probaby quicker than doing a recursive walk over
the tree copying each node individually.

Keys on the other hand can speed things up a lot (by several orders of
magnitude in some cases), but it depends what you are doing.  if you
are repeatedly doing //*[@id='foo'] for different values of foo then you
are walking over the tree lots of times, however if you do <xsl:key
name="x" match="*" use="@id""/> then essentially you geta hash table
which gives quick access to the nodes returned by the above, by going
key('x','foo') Note however you have to walk over the tree to build the
key, and you have to have the space to store the indexs so if you are
only doing each access once you probably don't win by using a key.

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.