cancel
Showing results for 
Search instead for 
Did you mean: 

String encoded XML inside XML, need to parse it into message

Former Member
0 Kudos

Hello, we have a 3rd party sending us information like:

<ns0:foo><content>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;

{lots more escaped XML here"}

</content>

</ns0:foo>

What is the best way to parse this internal content into a message type?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Ok I figured out an XSLT map which does a nice job of converting escaped XML back into a good format:

<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:value-of select="." disable-output-escaping="yes" />

         </xsl:copy>

    </xsl:template>

</xsl:stylesheet>

On my mapping I just get rid of the extra XML declaration and then put this XSLT at the end of the Operation Mapping. My output file is an XML file which can then be processed further inside normal PI mappings.

Answers (1)

Answers (1)

Former Member
0 Kudos


Hi Aaron,

This can be handled at mapping level by writing the Java mapping to deserialize the data.

After parsing to message type,  call graphical mapping if any structural transformations/business logics needs to be handled.

Regards,
Krupa

Former Member
0 Kudos

Thanks for the idea Krupa.

I wish there were a module bean included to do this in the adapter level (e.g. messagetransformbean). We are just not set up for doing Java mappings, I think they are too hard to troubleshoot and maintain vs normal GUI/UDF and XSLT mappings.