Templates

At the heart of the XSLT stylesheet are template elements. All the information in your stylesheet that is output will pass through a template. In short, they are the most important element in a stylesheet, and they are where you will define all the information for how text, elements, and attributes are to be output by your stylesheet.

There are a few elements that are related to templates and their use, so let's take a closer look at templates and how they function in XSL.

xsl:template

The most important element in the stylesheet is xsl:template. This element has several attributes, including priority, mode, name, and match. The priority attribute allows you to specify a numeric priority level for the template. The mode attribute allows ...

Get Special Edition Using XML, Second Edition 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.