We use xslt 1.0 with Xpath 1.0 and XalanJ 2.7.1. We make profiling of our templates and try to reduce the call time. So out biggest hotspot is:
<xsl:template name="tplAttribute">
<xsl:param name="sourceObject" />
<xsl:param name="sourceName" />
<xsl:param name="targetName" />
<xsl:variable name="sourceAttribute" select="$sourceObject/attribute[@name = $sourceName]" />
<xsl:if test="$sourceAttribute">
<dcx:attribute name="{$targetName}">
<xsl:value-of select="$sourceAttribute" />
</attribute>
</xsl:if>
</xsl:template>
The average time during 871 hits is 103 and for variable 59ms.
Is there any better solution in order to reduce the time of the transformation?
Edit: Input structure template calls when process 'sourceObject':
object
tplAttribute
tplAttribute
tplAttributeDefault
tplAttribute
tplAttributeSomeDifferentLogic
tplAttribute
tplAttributeOther