xml declaration not being omitted from page
- by Mark Schultheiss
I have an XSLT transform I am using to process an XML file, inserting it into the body of my aspx page.
Reference the following for background information:
background on xml/xslt
I have the following in my xml file:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl"
xmlns:myCustomStrings="urn:customStrings">
<xsl:output
method="xml" version="2.0"
media-type="text/html"
omit-xml-declaration="yes"
indent="yes"
/>...unrelated stuff left out here
Here is the output that is relevent:
<div id="example" />
<?xml version="1.0" encoding="utf-8"?><div xmlns:myCustomStrings="urn:customStrings"><div id="imFormBody" class="imFormBody">
My question relates to the output, specifically to the <?xml version="1.0" encoding="utf-8"?> which is getting included in the output anyway. Is the issue related to the custom method I have used? If so, I don't really see the need to include the xml part as the namespace is in the div tag. Is there a way to ensure that this extra stuff gets left out as I asked it to?