Share via


Outputs from an XslTransform

Since style sheets can determine the output format using an <xsl:output> statement with the method attribute, the following table describes what the output format is when the XslTransform.Transform method is used to write the output, and the output format is declared as a Stream or TextWriter. The following table describes what happens when an output type is declared by the Transform method in conjunction with the use of an <xsl:output> statement:

<xsl:output method = > Attribute Result format
method="xml" XML
method="html" HTML
method="text" Text

Note   The

<xsl:output>

statement is ignored when the output of the XslTransform.Transform method is an XmlReader or XmlWriter.

The following attributes are supported when the XslTransform.Transform method output is a Stream or TextWriter:

  • encoding*****

  • omit-xml-declaration

  • standalone

  • doctype-public

  • doctype-system

  • cdata-section-elements

  • indent

    Note   *****the encoding attribute is ignored when the XslTransform.Transform method is sending its output to a TextWriter. The encoding property on the TextWriter is used instead.

The following attribute is ignored when the XslTransform.Transform method output is a Stream:

  • version: the version is always 1.0
  • media-type: the media-type

See Also

XslTransform Class Implements the XSLT Processor