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

Re: keys fast for lookups? attribute-value template in

Subject: Re: keys fast for lookups? attribute-value template in xsl:call-template?
From: David_Marston@xxxxxxxxx
Date: Fri, 3 Aug 2001 22:12:44 -0400
Re:  keys fast for lookups? attribute-value template in
Mike Lamb writes:
>I had thought of using a key over this document to perform the lookup.
>My xsl is:
>  <xsl:key name="ziptodealer" match="ZIP" use="@zip"/>
>...
>This works fine, but as performance is really important here I would
>like some feedback about whether this is absolutely the fastest way to
>get this done.

General Principle: keys were designed so as to allow developers the
maximum potential for optimization. If anything can be tweaked for good
performance, keys should be it.

Lesser Principle: since "lazy evaluation" is an optimization tactic,
assume that you don't get a payoff until you look up a given value
more than once. If each zip is looked up once, you may not benefit.

Real-world answer: measure performance in your environment unless you
have clear-cut knowledge of how the Lesser Principle applies to you.

>Looks like the name attribute of xsl:call-template does not expect an
>attribute-value template.

That's correct.

>Any thoughts on how I might get this done? I am trying to avoid writing
>the huge switch statement over dealercode.

Look in the FAQ for some tricks. Also, look for commonalities among
dealers (to share templates) or ways to throw more parameters at the
template. Use more keys on dealercode to set parameter values.
.................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.