Re: [xsl] Performance

Subject: Re: [xsl] Performance
From: Andrew Franz <afranz0@xxxxxxxxxxxxxxxx>
Date: Thu, 13 Oct 2005 00:41:33 +1000
How about this?

....
<xsl:variable name="inc"><xsl:apply-templates select="*" /></xsl:variable>
<br/>count is: <xsl:value-of select="string-length(normalize-space($inc))" />
</xsl:template>


<xsl:template match="*[not(starts-with(name(), 'DGBUIMSNNumber'))]" priority="+1" />
<xsl:template match="*[@action='default']">d</xsl:template>
<xsl:template match="*[@action='add']">a</xsl:template>
<xsl:template match="*" />



Khorasani, Houman wrote:


I just have noticed

This way of writing the code is much faster

count(*[starts-with(name(),'DGBUIMSNNumber')][@action='add'])

than this way:

count(*[starts-with(name(),'DGBUIMSNNumber') and @action='add'])


Why is that?



And how do I write this piece of code like the above in the 'faster' way?

count(*[starts-with(name(),'DGBUIMSNNumber') and (@action='default' or
@action='add')])


Because this would imply I had two 'and' instead of one 'and' and one 'or' correct?

count(*[starts-with(name(),'DGBUIMSNNumber')][@action='default'][@action
='add'])


Regards Houman

Current Thread