xsl-list
[Top] [All Lists]

RE: Use predicates/patterns or xsl:choose (was:] Stylesheet optimisation)

2005-01-11 10:15:31
I don't think I would give the same advice today. I wouldn't expect it to
make much difference in performance (certainly, there's no intrinsic reason
why it should make a difference), and stylistically, using multiple template
rules is often much clearer.

Michael Kay 
http://www.saxonica.com/


-----Original Message-----
From: christof(_dot_)hoeke(_at_)e-7(_dot_)com 
[mailto:christof(_dot_)hoeke(_at_)e-7(_dot_)com] 
Sent: 11 January 2005 15:27
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] Use predicates/patterns or xsl:choose (was:] 
Stylesheet optimisation)

Hi again,
I was reading up all stuff about optimizing the performance 
of xslt. One basic advice I found is:

      "Avoid complex patterns in template rules. Instead, use 
<xsl:choose> within the rule."

      (Mike Kay at 
http://www.dpawson.co.uk/xsl/sect4/N9883.html#d12447e254)

This seems quite old (before July 2000), and I wondered if it 
is still true with newer Saxon or Xalan versions.

I rather split complex templates in more than one and adjust 
the match patterns accodingly to shorten and simplify the 
actual code inside the xsl:template. So I try to avoid using 
xsl:choose or xsl:if areas as much as possible as they make 
the stylesheet sometimes quite difficult to read and maintain. 
And I was under the impression that splitting complex 
templates in easier ones by making the match as precise as 
possible would also be quicker as I (naively) thought the 
processor does something like a lookup table before actually 
performing the transformation.

So, is it still better to avoid complex patterns or am I 
understanding the advice in the wrong way?

Thanks a lot
Chris


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--




--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--