Hi Experts,
Please help me in achieving below issue
In source message we don't have the xml namespace, ns tag, and encoding we need to insert those by using the Anonymizer Bean
Source file
Source Message:
<FL_R_IN_IFD>
<MsgData>
<R_HEADER>
<R_DETAIL>
</R_DETAIL>
</R_HEADER>
</MsgData>
</FL_RA_IN_IFD>
Expected:
<?xml version="1.0" encoding="UTF-8"?>
<ns0:FL_R_IN_IFD xmlns:ns0="http://Test/Test/Test/ECC">
<MsgData>
<R_HEADER>
<R_DETAIL>
</R_DETAIL>
</R_HEADER>
</MsgData>
</ns0:FL_R_IN_IFD>
Please help me
Thanks,
MR
Hello Mahi,
You can use the below XSLT mapping and use it after graphical mapping in OM to add namespace.
<?xml version='1.0' encoding='utf-8'?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" encoding="UTF-8"/>
<xsl:template match="/">
<ns0:FL_R_IN_IFD xmlns:ns0="http://Test/Test/Test/ECC">
<xsl:copy-of select="." />
</ns0:FL_R_IN_IFD>
</xsl:template>
</xsl:stylesheet>
Or to do the same using beans. Refer the below link
http://wiki.scn.sap.com/wiki/display/XI/Changing+Namespaces+and+the+encoding+format+of+XML
Did you create your interface structure inside ESR? Then you could remove the XML namespace from message type. Then your graphical mapping tool would work with source message without namespace. The XMLAnonymizerBean does not work for your scenario as expected, so you cannot use it.
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform xmlns:ns0="http://Test/Test/Test/ECC" >
<xsl:template match="/">
<xsl:copy-of select=".">
</xsl:template>
regards,
Nikhil Bose
do you want java mapping for that? if yes tell me its a one shot solution but then implementing a java mapping can be a bit cumbersome because you need to compile then make a jar then import and then test it.
Add a comment