Q: Determining which disjunct in an xsl:template match matched Suppose I have XML like this:
<xsl:template match="assessment | section ">
             .
             .
             .
</xsl:template>

I do this because I mostly want to treat assessment and section nodes the same.  However, I do want to treat them a little differently.  How can I tell whether a match was for assessment or for section?

A: Do something like this:
<xsl:if test="name()='section'">
</xsl:if>


A: You may test for:
self::assessment

which is slightly more efficient than using the name() function.
However in cases like this I will put the common code in another template (either named or in a named mode) and will instantiate the common processing like this:
<xsl:apply-templates select="." mode="common"/>

