In a stylesheet I would like to choose a template based on an attribute in the source xml. Unfortunately it looks as if one cannot use the mode attribute of apply-templates as this must be a qname literal. Is there any other similar way to do this?
Example:
source xml:
...
<document type="1">
<item>...</item>
</document>
...
stylesheet:
...
<xsl:template match="document">
<xsl:apply-templates select="item" mode="{@type}" />
</xsl:template>
<xsl:template match="item" mode="1">
...
</xsl:template>
<xsl:template match="item" mode="2">
...
</xsl:template>