Hi,
I have an application which sends XML message similar to:
<ParentElement>
<Data><![CDATA[< ;?xml version="1.0" encoding="UTF-8"?> ;
< ;Element1> ;
< ;Element2> ;mydata< ;/Element2> ;
< ;/Element1> ;]]></Data>
</ParentElement>
I require to fetch the content from the Data element and convert it to XML. I do this by fetching the content in Data element as String and replacing < ; > ; and " ; using replaceAll method in java.lang.String and then use DOM API to convert String to XML. Is there a better way of doing this instead of using the replaceAll method and transforming the xml in String to DOM? Please note for display purposes I have a space between lt and semi-colon in the XML