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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.