on 03-08-2008 4:33 PM
Source:
<?xml version="1.0" encoding="UTF-8"?>
<ns0:MT_Org_In xmlns:ns0="http://source.google.com">
<Org_recs>
<Sales_Org>1234</Sales_Org>
<Sales_Org_Desc>chicago Brew</Sales_Org_Desc>
<Dist_Channel>10</Dist_Channel>
</Org_recs>
</ns0:MT_Org_In>
Target:
<?xml version="1.0" encoding="UTF-8"?>
<ns1:SubmitXML xmlns:ns1="http://target.google.com">
<ns1:sLabel>MT_Vel_Org_In</ns1:sLabel>
<ns1:sXML><![CDATA[
<ns0:MT_Org_In xmlns:ns0="http://source.google.com">
<Org_recs>
<Sales_Org>1234</Sales_Org>
<Sales_Org_Desc>chicago Brew</Sales_Org_Desc>
<Dist_Channel>10</Dist_Channel>
</Org_recs>
</ns0:MT_Org_In>
]]>
</ns1:sXML>
</ns1:SubmitXML>
Please Note: 1. Namespace Changes btween Source and Target
2. <sLabel> in target contains the name of the root in source
3. Whole source XML goes into <sXML> of target with <![CDATA[ ....]]>
Experts please help me with XSL Source. Appreciate all your help and suggestions.
Try following code,
There is possibility of one line not executed because of CDATA. Try it first to see what happens.
Regards
Liang
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ns0="http://source.google.com"
xmlns:ns1="http://target.google.com">
<xsl:output method="xml" encoding="UTF-8" />
<xsl:template match="/">
<ns1:SubmitXML>
<ns1:sLabel>MT_Vel_Org_In</ns1:sLabel>
<ns1:sXML>
<xsl:text><![CDATA[</xsl:text>
<xsl:copy-of select="." />
<xsl:text>
]]>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.