[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Variable or Query for Speed
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|