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

Re: Variable or Query for Speed

Subject: Re: Variable or Query for Speed
From: David Carlisle <davidc@xxxxxxxxx>
Date: Wed, 5 Feb 2003 09:09:48 GMT
use variable in query

If it's just a single attribute (rather than a great long xpath  it'll
	probably not make any difference, but don't (hardly) ever do
	this

<xsl:variable name="tableName">
	<xsl:value-of select="@name" />
</xsl:variable>


do this

<xsl:variable name="tableName"select="@name" />

which is less typing and a lot more efficient.

in fact using an Xpath and using a variable may not make _any_
difference whatsoever.
Some systems "notice" that you re-use the same xpath over and over again
so effectively make an internal variable and use that,  systems might not
actually save the results of a variable binding and re-evaluate it each
use. So even if you write the code one way your system may optimise it
to use the other....

The answer to any of these "speed" questions is to use a stopwatch on
teh system you are using and just time the two approaches. If you
can't tell the difference, it doesn't matter...

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.