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

Re: XSL sheet Optimisation

Subject: Re: XSL sheet Optimisation
From: David_Marston@xxxxxxxxx
Date: Tue, 24 Apr 2001 11:10:04 -0400
sheet optimisation
Robert Koberg writes:
>Would it be better (faster) to create keys for all the sections and access
>the particular section with its key:
>  <xsl:apply-templates select="key('mykey', $id)"/>
>or would it be better to do something like:
>  <xsl:apply-templates select="//*[@id=$id]"/>
[The "id" attributes are not genuine IDs.]

I think the former approach ought to be way better. Have one keyspace for
all the sections if you don't care about their depth. Notice that since
the processor has no way of knowing whether "id" values repeat, the select
of "//*[@id=$id]" always has to scan the entire tree. That expression
could be improved, but I don't think it can get better than the key()
approach.

However, bear in mind that keys really begin to pay off when a given key
is used more than once. After a node is found the first time and an
entry is made in some internal table representing the keyspace, then
subsequent selects can go straight to the node(s) with that key.
.................David Marston


 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.