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 <[email protected]> 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. >
