xml declaration not being omitted from page
        Posted  
        
            by Mark Schultheiss
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Mark Schultheiss
        
        
        
        Published on 2010-03-29T18:08:58Z
        Indexed on 
            2010/03/29
            18:13 UTC
        
        
        Read the original article
        Hit count: 467
        
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:
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?
© Stack Overflow or respective owner