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

Re: calling a template and xsl:include

Subject: Re: calling a template and xsl:include
From: Robert Koberg <rob@xxxxxxxxxx>
Date: Wed, 22 Sep 2004 17:30:38 -0700
xsl include performance
Francesco Barresi wrote:

Hi all,
I have 2 questions:
I remember that I once saw somewhere a snippet of XSLT code about
calling a template having the name in a variable, something like this:

<xsl:call-template select="$tempalteToCall"/>



Can't do this.You can do something like:


<xsl:choose>
 <xsl:when test="$condition='choice1'">
   <xsl:call-template name="choice1"/>
 </..
 <xsl:when test="$condition='choice2">
   <xsl:call-template name="choice2"/>
..etc..

As far as I know this can't be done with XSLT 1.0, but there was a
work-around to do so. Any one know how to do that or where to find
info about that? It would help.

The other question is about performance. I use many xsl:include and I
would like to know if this could cause some notable performance issue
on the processor?



In java you would create a Templates object and cache that. That will resolve your includes/imports once and so your only performance hit would be building that object. Then you would build the transformer off of the templates object.


I have many imports (around 15) and pretty complex XSL. After building the Templates object, my transforms are are in the 20-30 millisecond range. I haven't had to scale my app to several thousands of users so I don't know what how that would affect my transform speed.

hth,
-Rob

Thanks.
Bye

Francesco.

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.