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

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>