Name

xsl:output

Synopsis

<xsl:output
  method                 = "xml" | "html" | "text" | "PrefixedName"
  version                = "NMTOKEN"
  encoding               = "encoding_name"
  omit-xml-declaration   = "yes" | "no"
  standalone             = "yes" | "no"
  doctype-public         = "PUBLIC_ID"
  doctype-system         = "SYSTEM_ID"
  cdata-section-elements = "element_name_1 
                     element_name_2..."
  indent                 = "yes" | "no"
  media-type             = "string" />

The top-level xsl:output element helps determine the exact formatting of the XML document produced when the result tree is stored in a file, written onto a stream, or otherwise serialized into a sequence of bytes. It has no effect on the production of the result tree itself.

Attributes

method, optional

The default method is xml, which simply means that the serialized output document will be a well-formed external parsed entity or XML document. If method is set to html, or if the method attribute is not present and the root element of the output tree is html, in any combination of case, then the processor attempts to generate HTML that is more compatible with existing browsers. For example, empty-element tags like <br/> are converted to <br>. The text method outputs only the contents of the text nodes in the output tree. It strips all markup. XSLT processors may also recognize and support other values that are indicated by prefixed names, such as saxon:xhtml and jd:canonical-xml.

version, optional

A name token that identifies the output method’s version. In practice, this has no effect on the output.

encoding, optional

The encoding the ...

Get XML in a Nutshell, 3rd 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.