Top-Level Stylesheet Elements

XSL defines a number of top-level elements that can be direct child elements of <xsl:stylesheet>:

  • <xsl:attribute-set>

  • <xsl:decimal-format>

  • <xsl:import>

  • <xsl:include>

  • <xsl:key>

  • <xsl:namespace-alias>

  • <xsl:output>

  • <xsl:param>

  • <xsl:preserve-space>

  • <xsl:strip-space>

  • <xsl:template>

  • <xsl:variable>

The XSLT 1.1 working draft adds one more top-level element:

  • <xsl:script>

You’ll see all these official top-level XSLT elements in this book.

Note that in addition to all these top-level elements, you can also use normal XML comments throughout, because XSLT stylesheets are also XML documents:

 <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <!-- This template matches all ...

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.