Jump to content

How to copy doctype and root element


mwunderlich

Recommended Posts

Dear all, I have problems transforming an XML document using XSLT. The <!DOCTYPE XYZ> and the root element <XZY> are not output when I use the following syntax:

<xsl:template match="/"> 	 <xsl:copy>      <xsl:apply-templates /> 	 </xsl:copy></xsl:template>

So, instead I tried the following:

<xsl:template match="/">	<xsl:text disable-output-escaping="yes">   <!DOCTYPE XYZ>	</xsl:text>	<xsl:element name="XYZ">    <xsl:copy>      <xsl:apply-templates />    </xsl:copy> 	 </xsl:element></xsl:template>

This gives me the root element alright, but still won't output the DOCTYPE. Any idea what to improve?Cheers, Martin

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...