on 09-28-2011 4:37 PM
Dear all,
I have a XSL-Mapping where the namespace don't get copied.
I need the complete source structure in the target field SDATA.
Source XML:
<?xml version="1.0" encoding="utf-8"?><ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge" xmlns:p2="urn:sap-com:document:sap:idoc:messages" xmlns:ns1="http://example/test">
<ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">
<ns0:Message1>
<ns1:MainNode xmlns:ns1="http://example/test">
<FirstNode>
.....
XSL mapping:
<SDATA>
<xsl:text disable-output-escaping="yes"><![CDATA[<![CDATA[
]]
>
]]>
Result:
<SDATA>
<![CDATA[ <ns1:MainNode >
<FirstNode>
......
My question: Why is the namespace xmlns:ns1="http://example/test" not in the target message?
Thanks
Chris
Edited by: Christian Riekenberg on Sep 28, 2011 5:46 PM
what about reaults when you tested XSL in XML Spy.?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Christian,
Try it with an "identity transform":
Run this XSLT to get rid of namespaces:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:template match="*">
<xsl:element name="{local-name()}">
<xsl:apply-templates select="@* | node()"/>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
Then run this one:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="/">
<SDATA>
<xsl:copy-of select="."/>
</SDATA>
</xsl:template>
</xsl:stylesheet>
Best regards,
Peter
Edited by: Peter Wallner on Sep 29, 2011 7:42 PM
User | Count |
---|---|
72 | |
11 | |
10 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.