on 07-08-2014 2:21 PM
Hi Experts,
we are working on SAP PI version 7.0.
We are getting a SOAP response from 3rd party system.. as per below screen shot.
We need to read the data in field "DATA"and we have to send same data as request to ECC through proxy.
please suggest the java mapping code to read the XML file data which is present in the "DATA" field and parse it to target structure.
please let me know if any info required.
Thanks in advance.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
It's a straight forward XSLT, not sure where u are struggling?
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output omit-xml-declaration="yes"/>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="/">
<xsl:value-of select="//Data" disable-output-escaping="yes"/>
</xsl:template>
</xsl:stylesheet>
Note - adjust namespaces according to ur structure
Thanks
Amit Srivastava
Hi Amit,
I have tried with the XSL code and its generating the XML structure as per the data maintained in the "Data" field.
The problem is, the input structure is static and the data present in the "Data" field is dynamic.
The output XML structure is getting generated with the data present in the "Data" field properly as per the provided screenshot.
I cant send the same output different XMl structures to ECC as there should be fixed structure in the proxy to be written.
Could you please provide me the code which will create the Message Type with the namespace, so that i can use the same in the next message mapping after the XSLT mapping and do the necessary modifications.
Regards,
Chaitanya
Hello,
U need a little bit of adjustment in xslt , check below code
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:ns0="http://test" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="/">
<ns0:MT_Name>
<xsl:variable name="data">
<xsl:value-of select="substring(//Data, 39)"/>
</xsl:variable>
<xsl:value-of select="$data" disable-output-escaping="yes"/>
</ns0:MT_Name>
</xsl:template>
</xsl:stylesheet>
Thanks
Amit Srivastava
User | Count |
---|---|
76 | |
9 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.