This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Several rules vs a single rule with a choose operator
- To: xsl-list at lists dot mulberrytech dot com
- Subject: [xsl] Several rules vs a single rule with a choose operator
- From: "Alexander Gutman" <gutman at novosoft-us dot com>
- Date: Sat, 28 Jul 2001 16:03:05 +0700
- Reply-To: xsl-list at lists dot mulberrytech dot com
Hello, friends.
How do you think, which of the following two approaches
is more effective (particularly, for MSXML):
<xsl:template match="node-test[condition2]" priority="2">
result2
</xsl:template>
<xsl:template match="node-test[condition1]" priority="1">
result1
</xsl:template>
<xsl:template match="node-test">
result0
</xsl:template>
or
<xsl:template match="node-test">
<xsl:choose>
<xsl:when test="condition2">result2</xsl:when>
<xsl:when test="condition1">result1</xsl:when>
<xsl:otherwise>result0</xsl:otherwise>
</xsl:choose>
</xsl:template>
The effectiveness question is important in my case,
since I employ a large set of template rules
and, moreover, apply it several times per request.
Thanks.
--
Alexander E. Gutman
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list