Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here.

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 Transform method is used to write the output, and the output format is declared as a Stream or TextWriter.

NoteNote:

The XslTransform class is obsolete in the .NET Framework version 2.0. You can perform Extensible Stylesheet Language for Transformations (XSLT) transformations using the XslCompiledTransform class. See Using the XslCompiledTransform Class and Migrating From the XslTransform Class for more information.

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 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

NoteNote:

Note: The <xsl:output> statement is ignored when the output of the Transform method is an XmlReader or XmlWriter.

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

  • encoding*

  • omit-xml-declaration

  • standalone

  • doctype-public

  • doctype-system

  • cdata-section-elements

  • indent

    NoteNote:

    *the encoding attribute is ignored when the 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 Transform method output is a Stream:

  • version: the version is always 1.0

  • media-type: the media-type

The <xsl:text disable-output-escaping> tag is used to indicate whether or not special characters need to be escaped into an XML form (for example, using <&lt> in place of the "<" symbol) or left in the present condition. The disable-output-escaping attribute is ignored when transforming to an XmlReader or XmlWriter object and has no effect on special characters.

Show:
© 2015 Microsoft