Altova Mailing List Archives

Re: [xsl] xsl:call-template & performance?

From: Mike Brown <mike@-------->
Date: 12/21/2000 3:12:00 AM
Hillyard, Matthew wrote:
> Apart from the obvious benefits of modularity and maintainability, does
> anyone have any empirical (or anecdotal) evidence as to the relative
> performance of using xsl:call-templates against repetitive xsl:templates
> always written out in full in situ?

This would seem to be something that depends on the processor
implementation, and to some degree, your source tree and the kind of
processing you are doing on it. Even how you access the data (//foo vs
/path/to/foo, for example). I'm sure someone could find a counterexample
for any example provided.

That said, I recently discovered that SAXON gets pretty slow when I am
many levels deep into nested call-templates/with-param blocks, where some
of the params you pass are the result tree fragments returned by the
nested call-templates instructions.

Or did you mean to ask about the relative advantages of having templates
that match various nodes and letting the processor navigate the source
tree via apply-templates, vs the approach of making one big template that
matches just the root node, occasionally calling named templates to do
repetitive tasks? I haven't found any persuasive performance stats one
way or the other to argue a case on that basis alone.

   - Mike
Mike J. Brown, software engineer at            My XML/XSL resources: in Denver, Colorado, USA    

 XSL-List info and archive:


These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.