Subject: Re: [xsl] Variable or Query for Speed From: David Carlisle <davidc@xxxxxxxxx> Date: Wed, 5 Feb 2003 09:09:48 GMT |
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 |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] Variable or Query for Spe, Michael Kay | Thread | RE: [xsl] is XSLT 2.0 implementable, Sergiu Ignat |
Re: [xsl] xsl:output/@indent="yes" , David Carlisle | Date | Re: [xsl] is XSLT 2.0 implementable, David Carlisle |
Month |