Is it possible to check the type of a node I matched with a template inside the same template? In case it is, how can I do it? For example I would like to do something like this:
<xsl:template match="@*|node()">
<xsl:choose>
<xsl:when test="current() is an attribute">
<!-- ... -->
</xsl:when>
<xsl:when test="current() is an element">
<!-- ... -->
</xsl:when>
<xsl:otherwise>
<!-- ... -->
</xsl:otherwise>
</xsl:choose>
</xsl:template>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…