Use custom template name in <xsl: apply-templates>

I currently have this code that invokes a "custom" template for each node user.

<xsl:for-each select="./user|./UnformatedUser">
  <xsl:apply-templates select=".">
    <xsl:with-param name="span"/>
  </xsl:apply-templates>
</xsl:for-each>

However, now I want to use a template called "fulluser" for all users. I tried adding name="fulluser"to the tag <xsl:apply-templates>, but that didn't work.

+5
source share
2 answers

The instruction <xsl:apply-templates>does not use the template name to select a template to execute on a particular node. It uses a pattern matching pattern when choosing a pattern.

To select a template for execution by name, use the <xsl:call-template>instruction .

+14

xsl: call-template?

+2

All Articles