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

Subject: RE: [xsl] xsl:call-template & performance?
From: "Hillyard, Matthew" <matthew.hillyard@xxxxxxxxxx>
Date: Thu, 21 Dec 2000 19:02:00 -0000
Having matched an important first child node of the root, my document tree
can then descend through any one of 35 possible permutations of an 8-level
hierarchy, which is not only unpredictable from document to document, but
which can even alter mid-document, i.e. all levels inbetween top & bottom
are optional:

the important root child node can spawn:
 3 possible child nodes, which can spawn 
  6 possible child nodes, which can spawn
   8 possible child nodes, which can spawn
    8 possible child nodes, which can spawn
     6 possible child nodes, which can spawn
      3 possible child nodes, which can spawn
       1 possible child node

My stylesheet currently consists of 35 relatively nested <xsl:for-each>
loops cascading out of one large main <xsl:template> for that first
important root child, and is that way because the formatting of content
depends variously on the depth reached by each descendant and its relative
ancestry.

So given that, say, certain titles require a certain
font/size/colour/alignment, would it be more efficient to set that
transformation in a named template before the one large main template, and
instantiate it as necessary with <xsl:call-template>, or would it be more
efficient to simply repeat the particular font/size/colour/alignment
transformation *in full* at each node where it is required??

I'm using MSXML3. Perhaps I should just conduct my own performance tests and
let the List know...!

> ----------
> From: 	Mike Brown[SMTP:mike@xxxxxxxx]
> 
	[...]

> 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: 
> webb.net in Denver, Colorado, USA              http://skew.org/xml/


-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity
to whom they are addressed.  If you have received this email in error please notify the system manager.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread