3.1. Templates: The Building Blocks of Transformations

In the simplest sense, a template is a model. In XSLT, a template has a very specific structure, consisting of 18 instruction elements, LREs, extension elements, and text.

There are eleven elements that can contain templates: <xsl:template>, <xsl:if>, <xsl:when>, <xsl:otherwise>, <xsl:with-param>, <xsl:variable>, <xsl:param>, <xsl:element>, <xsl:copy>, <xsl:message>, and <xsl:fallback>. The most important and frequently used top-level element that can contain a template is the <xsl:template> element. This element is discussed in detail in Section 3.1.2.

template: An instrument used as a gauge or guide in bringing any piece of work to the desired shape … a molecule or molecular pattern that ...

Get XSLT and XPATH: A Guide to XML Transformations 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.