Skip to Content
0
Former Member
Mar 20, 2008 at 02:31 PM

Complete XML to a field

24 Views

Hi,

Is there a way you can map a complete XML to a string field including <?xml version="1.0" encoding="UTF-8"?>?

The below is the XSL code I'm using:

<?xml version="1.0" encoding="UTF-8"?>

http://www.w3.org/1999/XSL/Transform" xmlns:ns0="http://my.url">

<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>

<xsl:template match="/">

<Import>

<importXML>

<xsl:copy-of select="." />

</importXML>

</Import>

</xsl:template>

</xsl:stylesheet>

I also have tried the below:

<?xml version="1.0" encoding="UTF-8"?>

http://www.w3.org/1999/XSL/Transform" xmlns="http://my.url">

<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>

<xsl:template match="/">

<Import xmlns="http://my.url/">

<importXML>

<xsl:text disable-output-escaping="yes"><![CDATA[<![CDATA[]]></xsl:text>

<xsl:copy-of select="/"/>

<xsl:text disable-output-escaping="yes"><![CDATA[]]]]></xsl:text>

<xsl:text disable-output-escaping="yes"><![CDATA[>]]></xsl:text>

</importXML>

</Import>

</xsl:template>

</xsl:stylesheet>

The above code basically moves all the XML except for <?xml version="1.0" encoding="UTF-8"?>.

Thanks.