Subject: Re: [xsl] Performance Question: Expensive Functions in Predicates From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx> Date: Thu, 27 May 2004 12:03:29 -0400 |
I have a general question about predicting performance in the general case. I know that the best answer is "try it and see" but I'm wondering if there's a general principle that can guide design in this particular case.
My question is where, in general, is the best place to use these functions:
- In apply-templates specifications?
- In match specifications?
- As IF blocks within templates?
For example, I could do this:
<xsl:apply-templates select="*[util:is_applicable()]"/>
Or
<xsl:template match="foo[util:is_applicable()]">
or
<xsl:template match="foo"> <xsl:if test="util:is_applicable()"> </xsl:if> </xsl:template>
<appls> <appl id="this" appl="yes"/> <appl id="that" appl="no"/> <appl id="other" appl="yes"/> </appls>
Another option of course is to do the applicability processing as a separate step so that the base processing templates don't have to care about applicability.
That would ensure that each element is only processed once for applicability but might introduce other performance or scalability issues since one would have to generate either a new serialized instance or a new result tree reflecting the input document(s).
It would be a cleaner engineering solution as it would mean base template writers wouldn't have to know about the need to do applicability checks.
- authoring (creating the raw content) - production (determining the applicable content) - publishing (acting on the assembled result to produce multiple outputs)
-- Public courses: Spring 2004 world tour of hands-on XSL instruction Next: 3-day XSLT/XPath; 2-day XSL-FO - Birmingham, UK June 14,2004
World-wide on-site corporate, govt. & user group XML/XSL training. G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995) Male Breast Cancer Awareness http://www.CraneSoftwrights.com/s/bc Legal business disclaimers: http://www.CraneSoftwrights.com/legal
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] Performance Question: Exp, M. David Peterson | Thread | Re: [xsl] Performance Question: Exp, Eliot Kimber |
RE: [xsl] exclude-result-prefixes i, Matt Frank | Date | Re: [xsl] Changing Attribute Value , David Carlisle |
Month |