on 08-03-2009 8:25 AM
Hi all,
we are using a receiver FILE channel to generate an XML file that is sent to an external partner.
The XML file looks good in a parser (IExplorer). But in fact there are not carriage return / line feeds between the XML tags
of the XML payload in the file.
Our partner now requires the XML file in a more vertical structure which means: for every tag a separate line (like it is displayed in a parser)
Does anybody know a more general way to convert to a vertical XML structure (so with carriage return line feed).
There is one entry in the SDN dealing with this topic but suggesting using an UDF. I think this is a very specific way.
I don't think it is a good way to change/enhance the message mapping just because of a general formating change.
Is it better to use an XSLT mapping as a second step in the interface mapping or a JAVA adapter module to convert ?
any experiences? suggestions? examples?
Thank you very much
best regards
Hans
examples:
original by XI receiver FILE adapter
<?xml version="1.0" encoding="UTF-8"?>
<MT_batchStatus><type>BS</type><header><message><messageSender>SENDER</messageSender><messageDate>20090723143720</messageDate> ... and so on
required:
<?xml version="1.0" encoding="UTF-8"?>
<MT_batchStatus>
<type>BS</type>
<header>
<message>
<messageSender>SENDER</messageSender>
<messageDate>20090723143720</messageDate>
... and so on
Hi Hans,
Here's a generic example if you decide to use xslt:
<?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" indent="yes" />
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
-Russ
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi!
I think the best way is to use an adapter module. SAP has built such a sample for the inbound case. But it should also be possible to adapt this sample to the outbound case. It is part of the adapter module development how to guide.
Presentation: https://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/00838345-708c-2a10-1199-9514c0b0a91c
Guide: ... cannot find it anymore for PI 7.1. Please search for thing like this: "How To Module Adapter Engine"
Regards,
Volker
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
>
> Is it better to use an XSLT mapping as a second step in the interface mapping or a JAVA adapter module to convert ?
> any experiences? suggestions? examples?
In such a case, the best is to write an generic XSLT or Java mapping that will attempt to do the pretty printing/formatting of the xml.
The advantage of a generic one is that you can reuse the same class/jar for many other scenarios.
so the flow will be as below in your interface mapping;
1. your specific source to target mapping
2. the generic formatting class
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.