on 01-05-2012 12:07 PM
Hello every one,
I have just done a file to file Scenario
Actually the requirement is my trading partner want target xml like shown below
<?xml version="1.0" ?>
- <ACKNOWLEDGE_DELIVERY_001>
- <CNTROLAREA>
- <BSR>
<VERB value="ACKNOWLEDGE">ACKNOWLEDGE</VERB>
<NOUN value="DELIVERY">DELIVERY</NOUN>
<REVISION value="001">001</REVISION>
</BSR>
But for me after i have done the whole scenario it is comming like shown below
<?xml version="1.0" encoding="UTF-8" ?>
- <ns0:MT_Ack_Delivery_Inbound xmlns:ns0="urn:commscope.com/ALUespares/AckDelivery">
- <ACKNOWLEDGE_DELIVERY_001>
- <CNTROLAREA>
- <BSR>
<VERB value="ACKNOWLEDGE">ACKNOWLEDGE</VERB>
<NOUN value="DELIVERY">DELIVERY</NOUN>
<REVISION value="001">001</REVISION>
</BSR>
You might have noticed the difference between the two xml
The Message Type and Name Space part as shown below should not come according to requirement
- <ns0:MT_Ack_Delivery_Inbound xmlns:ns0="urn:commscope.com/ALUespares/AckDelivery">
Can any one please help me ho do i do that
Regards
Swetha
Edited by: swethaXI on Jan 5, 2012 1:14 PM
Hello every one,
>
> I have just done a file to file Scenario
>
> Actually the requirement is my trading partner want target xml like shown below
Would be nice if you could describe your scenario detailed and exactly to avoid missunderstandings.
Regards,
Udo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
sorry about the confusion my requirement is as shown below
Hello every one,
I have just done a Idoc flat file to xml file Scenario
Actually the requirement is my trading partner want target xml like shown below( tis is just a part of my target xml)
<?xml version="1.0" ?>
- <ACKNOWLEDGE_DELIVERY_001>
- <CNTROLAREA>
- <BSR>
<VERB value="ACKNOWLEDGE">ACKNOWLEDGE</VERB>
<NOUN value="DELIVERY">DELIVERY</NOUN>
<REVISION value="001">001</REVISION>
</BSR>
But for me after i have done the whole scenario it is comming like shown below
<?xml version="1.0" encoding="UTF-8" ?>
- <ns0:MT_Ack_Delivery_Inbound xmlns:ns0="urn:commscope.com/ALUespares/AckDelivery">
- <ACKNOWLEDGE_DELIVERY_001>
- <CNTROLAREA>
- <BSR>
<VERB value="ACKNOWLEDGE">ACKNOWLEDGE</VERB>
<NOUN value="DELIVERY">DELIVERY</NOUN>
<REVISION value="001">001</REVISION>
</BSR>
You might have noticed the difference between the two xml
The Message Type and Name Space part as shown below should not come according to requirement
- <ns0:MT_Ack_Delivery_Inbound xmlns:ns0="urn:commscope.com/ALUespares/AckDelivery">
Can any one please help me ho do i do that
Regards
Swetha
Hi Swetha,
does your IDoc xml flat file source looking 100% the same as the expected target except the namespace? Would be helpful if you could post (a part of) the source file.
If yes:
The xsl would not help because the copy expression copies as well the namespace. Most easy would be a message mapping. Create the normal extenal definition (including the ns) as source interface, the manipulated (excluding the ns) as target inteface. Then create a 1:1 mapping (there is a button in newer PI versions to map each field with same name).
Regards,
Udo
>>The Message Type and Name Space part as shown below should not come according to requirement
(by looking ur desc) u want to remove the MT along with the namespace and needs to have the final target structure starting from "ACKNOWLEDGE_DELIVERY_001" (as a root node) instead of ur message type name...then i guess XSLT will solve ur req.....why dont u try it just once and let us know(if u want to go with xslt)...
the copy expression is copying the structure from"ACKNOWLEDGE_DELIVERY_001"
Hi Udo,
i have tested the code (under OM) and i am getting the required structure...i am not sure whether i have not undertsood u correctly or i am testing something else
<?xml version="1.0" ?>
- <ACKNOWLEDGE_DELIVERY_001>
- <CNTROLAREA>
- <BSR>
<VERB value="ACKNOWLEDGE">ACKNOWLEDGE</VERB>
<NOUN value="DELIVERY">DELIVERY</NOUN>
<REVISION value="001">001</REVISION>
</BSR>
Thanks
Amit Srivastava
Hi Swetha,
Try this
1. since your XSD is not big, define a data type with the name ACKNOWLEDGE_DELIVERY_001. when you define with this name then you will have the top element as ACKNOWLEDGE_DELIVERY_001 and then define all the elments below as per the XSD.
2. Define the message type. You can remove the XML namespace under the MT
3. use XML anonymizer bean in the receiver file adapter to remove the name space. under the module tab add as below
AF_Modules/XMLAnonymizerBean Local Enterprise Bean 0
ModuleKey : 0
Parameter Name: anonymizer.acceptNamespaces
Parameter value: Leave it blank
It works for me . Give a try and let me know.
Thanks,
Srini
i guess u r done with ur req.....but in case u want to know the basics of xslt u can refer my article on xslt mapping:
u can also use xslt mapping...
add this xslt after the graphical mapping in OM
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="*">
<xsl:copy-of select="//ACKNOWLEDGE_DELIVERY_001"/>
</xsl:template>
</xsl:stylesheet>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.