0

Hi I tried to find out the solution for this but could get anything of much help.

The problem is that the CDATA section has a XML present in it and I want to escape the special character '&' present in it. I'am using XMLBeans and tried using XmlOptionCharEscapeMap but its throwing exception while parsing.

`XmlObject.Factory.parse(XMLString, xmlOptionsObj);`

here the setSaveSubstituteCharacters in xmlOptionsObj was set with XmlOptionCharEscapeMap Object.

XML example:

<Message xmlns="http://www.com.test/XMLSchema">
<Header></Header>
<Body><![CDATA[<Inner xmlns="http://www.com.test/XMLSchema">
<TagA>...</TagA>   
</Inner>]]></Body>
</Message>'
'
CuE
  • 361
  • 3
  • 9
  • check this post out : http://stackoverflow.com/questions/1328538/how-do-i-escape-ampersands-in-xml – grahamr Jun 21 '13 at 08:32
  • Thanks for the link, though cudnt find the way to escape the '&' sign in CDATA. – CuE Apr 09 '14 at 06:07

0 Answers0