Friday, 18 July 2014

Mule ESB: DOM-to-XML parser thows xml parser error when xml element has angles brackets in it



I have an input xml like:



<soapenv:Envelope xmlns:soapenv="http://ift.tt/sVJIaE" xmlns:urn="urn:sendRequest">
<soapenv:Header/>
<soapenv:Body>
<urn:Message>
<urn:id> 12345 </urn:id>
<urn:name> srinath </urn:name>
<urn:body> >Hello< </urn:body>
</urn:Message>
</soapenv:Body>
</soapenv:Envelope>


The Mule ESB DOM-to-XMl transformer gives error when it encounter '>' and '<' in tags. How do I escape this? Entering &lt etc not an option since end users wont be knowledgible.


The error thrown is: Message : com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '<' (code 60) in content after '<' (malformed start element?). at [row,col {unknown-source}]: [9,26] (javax.xml.transform.TransformerException) Code : MULE_ERROR--2


Any work around is helpful!


No comments:

Post a Comment