cancel
Showing results for 
Search instead for 
Did you mean: 

Java Mapping: "<" replace

Former Member
0 Kudos

Hi,

I'm performing a java mapping, but my input xml is formatted with "&lt" instead of "<" and "&gt" instead of ">"; How can I replace this characters in Java to obtain a good xml?

Thanks!

Accepted Solutions (1)

Accepted Solutions (1)

henrique_pinto
Active Contributor
0 Kudos

The input from mapping runtime won't have characters like these. Either these are characters are from a particular field in your input xml (and then they are defined as string and not as xml tags) or your sender system sends it like this, and then mapping wont resolve your issue, since you need to have a valid xml at receiver determination step (unless you are dealing with binary data transfer, which I think is not the case here).

Anyway, if you have another XML message as string in a field of your input XML, try to extract the string as a proper XML before passing it to java mapping. For example, you could use a XSLT like:

...
<xsl:template match="/myMT/field">
  <xsl:value-of select="." disable-output-escaping="yes"/>
</xsl:template>
...

where /myMT/field is the field that includes the XML as string.

If you are getting the whole XML message like that from sender system, then you'll need to treat it with an adapter module.

Regards,

Henrique.

Answers (0)