XSL: Turning Off XML Declaration

When using the system.web.ui.webcontrols.xml control to transform an xml file to html (using an xsl stylesheet), the control was adding a <?xml version=”1.0″ ?> declaration to the output. To turn this off, simple add the following to your xsl transform (inside the xsl:stylesheet node, but outside of any xsl:template nodes).

<xsl:output method=”xml” omit-xml-declaration=”yes”/>

You May Also Like

About the Author: rnowik

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.