Controlling Output

By default, an XSLT stylesheet produces an XML document. This can be changed using the xsl:output directive. The xsl:output directive must appear as a child element of the xsl:stylesheet element and must adhere to the following production:

<xsl:output
  method = "xml" | "html" | "text" | qname-but-not-ncname
  version = nmtoken
  encoding = string
  omit-xml-declaration = "yes" | "no"
  standalone = "yes" | "no"
  doctype-public = string
  doctype-system = string
  cdata-section-elements = qnames
  indent = "yes" | "no"
  media-type = string
/>

The most important of these attributes is the method attribute. The method attribute sets the output method of the XSLT stylesheet. If not provided, the default is typically XML.[3] XSLT provides two ...

Get Essential XML: Beyond Markup 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.