Templates

Template element

Templates are defined by the Template element.

<!ELEMENT xsl:template (#PCDATA %instructions;
                        %result-elements; | xsl:param)* >

The keyword '#PCDATA' refers to text that can be inserted directly into the Template element:

<xsl:template ...>REPLACE WITH THIS</xsl:template>

A template can also contain various instruction elements. Apart from the Param element, and the content of the Result Elements entity (described later), the Instructions entity is used to group the instruction elements, because they are also allowed in other locations (the For Each element and the Template entity):

<!ENTITY % instructions " %char-instructions; |
                          xsl:processing-instruction |
                          xsl:comment |
                          xsl:element |
                          xsl:attribute">

This entity ...

Get XSL companion, The 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.