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

Re: use-when attribute?

Subject: Re: use-when attribute?
From: Geert Josten <Geert.Josten@xxxxxxxxxxx>
Date: Sat, 18 Dec 2004 14:17:01 +0100
mike josten
Hi Bruce,

I was originally using keys (at your suggestion, in fact), but Mike Kay at one point seemed to suggest it better for my purposes to use a variable. I didn't quite understand why, but here's his explanation:

====
I don't really see what a key with a constant "use" expression achieves.
Apart from the fact that it applies to whichever document is current at the
time, you could just as well (and probably better) use a global variable

<xsl:variable name="citekey" select="//db:biblioref/@linkend"/>
====

You said: .... but I'm worried that's a bad idea from a performance standpoint. Any other alternatives?

So I gave you this one. It builds the same node set, but I am quite sure it won't need three loops through the document _and_ a union of the three results.

The big difference is that those global variables execute expressions. The keys contain match patterns. I am pretty sure that all keys are built with only a single pass through the document. If it isn't so, than the programmers haven't implemented it very cleverly, I would say...

I remember Mike saying that, and true, in that particular case it didn't really matter. But when adding multiple variables with such expressions, or a single one with a union like you suggested, I think it does...

Cheers.

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.