on 09-13-2015 3:01 PM
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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
<?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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Raghuraman,
Do i need to include my complete message type in the code..?
I am providing my message type here please provide the code accordingly
<FL_RA_IN_IFD>
<MsgData>
<RA_HEADER><
ORIGIN>LEGACY</ORIGIN>
<TRAN_DATE></TRAN_DATE>
<TRAN_SEQ>0000001</TRAN_SEQ>
<TRAN_CODE>RA</TRAN_CODE>
<TRAN_VERS>0006</TRAN_VERS>
<TRAN_SEG>0010</TRAN_SEG>
<TRAN_ACT>03</TRAN_ACT>
<RCP_TYP_TXT>DG</RCP_TYP_TXT>
<RA_NUM>856281</RA_NUM>
<VEN_ID>022019</VEN_ID>
<CUS_ID>022019</CUS_ID>
<CUS_NAME>VISKO TEEPAK, LLC</CUS_NAME>
<EXPD_DT/>
<FST_ACPT_DT />
<LST_ACPT_DT />
<ISS_DT />
<RTN_RSN_TXT />
<WH_ID>HQM</WH_ID>
<RA_DETAIL/>
<ORIGIN>LEGACY</ORIGIN>
<TRAN_DATE></TRAN_DATE>
<TRAN_SEQ>0000016</TRAN_SEQ>
<TRAN_CODE>RA</TRAN_CODE>
<TRAN_VERS>0006</TRAN_VERS>
<TRAN_SEG>0030</TRAN_SEG>
<TRAN_ACT>03</TRAN_ACT>
<RCP_TYP_TXT>DG</RCP_TYP_TXT>
<RA_NUM>856281</RA_NUM>
<LINE_NUM>0101</LINE_NUM>
<ITEM_NUM>M83311</ITEM_NUM>
<INV_STAT_TXT />
<QTY>10</QTY>
<CATCH_QTY>0</CATCH_QTY>
</RA_DETAIL>
</RA_HEADER>
</MsgData>
</FL_RA_IN_IFD>
This is complete structure
Hello Mahi,
Replace in the place of XXX your message Type Name and YYYY your 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:XXX xmlns:ns0="YYYY">
<xsl:copy-of select="." />
</ns0:XXX>
</xsl:template>
</xsl:stylesheet>
And use this before the graphical mapping
Mahi,
Try this,
<?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:XXX xmlns:ns0="YYYY">
<xsl:copy-of select="//MsgData" />
</ns0:XXX>
</xsl:template>
</xsl:stylesheet>
And one more thing try adding namespace in Message type and check whether it is adding namespace by default/
User | Count |
---|---|
86 | |
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.