Thanks for the quick reply! I am using XMLBeans 2.3.0. I am not using AXIOM APIs directly to create the response elements. Hence, I am not using OMText directly. >From the XMLBean api, I am able to use only setText and have not found a way to passin the CDATA type (neither in an overloaded setText nor in a setType).
Could you please share a code snippet showing how to pass the CDATA type using XMLBeans or how to get the OMText node from the XMLBean object. With XMLBeans I have <operationName>Document object. How do I get an OMText out of it to be able to set the Type. On Mon, Dec 7, 2009 at 3:39 PM, Andreas Veithen <andreas.veit...@gmail.com> wrote: > XMLInputFactory.properties can be used to preserve CDATA sections when > using Axiom to _parse_ an XML document (By default CDATA sections are > transformed to text nodes and coalesced with adjacent text nodes). On > the other hand, creating CDATA sections in output documents is > something that Axiom has always supported. > > Probably what you are doing is to create an OMText node with type TEXT > and content "<![CDATA[ROSEANNA]]>". In the output document, this gets > of course escaped. What you need to do instead is to create an OMText > node with type CDATA and content "ROSEANNA". > > Andreas > > On Mon, Dec 7, 2009 at 20:45, Ramya K Grama <ramyakgr...@gmail.com> wrote: >> Hello, >> We have been having issues with CDATA not being preserved by Axis2. >> In the response xml, the '<' are escaped to '<' >> So instead of <someTagName><![CDATA[ROSEANNA]]></someTagName> we get >> <someTagName><![CDATA[ROSEANNA]]></someTagName> in the response. >> >> Reading this >> http://people.apache.org/~veithen/synapse/faq.html#cdata >> suggestion, we tried creating XMLInputFactory.properties file >> containing this single line - javax.xml.stream.isCoalescing=false >> and placed the file under WEB-INF/classes and retried, again the same >> result. >> >> We are using Axis21.4, XMLBeans 2.3.0, Tomcat 6. >> >> The other idea was to programatically replace the escape characters >> using regular expressions - which I think is really not needed. >> >> Any help is highly appreciated. >> >