Template Bodies

Templates have very specific rules. They can contain <xsl:param> elements, followed by a template body, which can contain PCDATA, XSLT instructions, extension elements, and literal result elements.

XSLT Instructions

A number of XSLT elements, called instructions, may appear in a template body:

  • <xsl:apply-imports>

  • <xsl:apply-templates>

  • <xsl:attribute>

  • <xsl:call-template>

  • <xsl:choose>

  • <xsl:comment>

  • <xsl:copy>

  • <xsl:copy-of>

  • <xsl:element>

  • <xsl:fallback>

  • <xsl:for-each>

  • <xsl:if>

  • <xsl:message>

  • <xsl:number>

  • <xsl:processing-instruction>

  • <xsl:text>

  • <xsl:value-of>

  • <xsl:variable>

No other XSLT element may appear directly in a template body. As you’ll see in Chapter 9, the <xsl:param> element may appear in a template before the template ...

Get Inside XSLT now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.