The identity template looks like this:
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()" />
</xsl:copy>
</xsl:template>
Does <xsl:apply-templates select="@*|node()" /> select more than <xsl:apply-templates />, or could the identity template have been like this?
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates />
</xsl:copy>
</xsl:template>
What exactly is selected when I do the following?
<xsl:apply-templates />
is equivalent to:
and this is a shorter former of:
and this is a equivalent to:
As we see from the last instruction, the
xsl:apply-templatesinstruction you are asking about, doesn’t select any attributes, therefore it cannot be used as a shorthand for: