5

Currently I have this code which calls the "user" template for each user node.

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

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

ThiefMaster
  • 298,938
  • 77
  • 579
  • 623

2 Answers2

14

The <xsl:apply-templates> instruction doesn't use a template name to select a template for execution on a particular node. It only uses the match pattern of templates when deciding which template to select.

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

Dimitre Novatchev
  • 235,605
  • 26
  • 291
  • 421
2

why not use xsl:call-template ?

dvhh
  • 4,663
  • 28
  • 32