[jboss-user] [JBossWS] - Java to XML for web services

AceFrehley do-not-reply at jboss.com
Tue Apr 29 15:38:37 EDT 2008

Hi. I have a java pojo that I am converting to an XML string and then returning from a web service (JAXB). I have to make sure that the data is returned in a CDATA block, so I used XMLSerializer from this example as a guide:

  | https://jaxb.dev.java.net/faq/JaxbCDATASample.java

Everything works fine, but I have read that in Xerces 2.9.0, the XMLSerializer and OutputFormat classes are deprecated. What is the equivalent (non-deprecated) code for transforming a Java pojo to XML? I cannot find any examples online that do the equivalent type of this transformation using STAX or DOM.If anybody could share an example or their approach to doing this, that would be great.

Also, I am using the Marshaller from JAXB, but just to reiterate, I also need the XMLSerializer functionality which prevents <> characters from being returned as HTML &lt; and &gt; tags to the client.

Also, how can I find out what version of Xerces is used for a particular version of JBoss AS? I would like to know the Xerces version for JBoss AS 4.2.2 and 5.0. I checked inside the xercesimpl.jar in the lib/endorsed directory, but the manifest file said Xerces version 1.2? Am I reading that correctly?


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4147635#4147635

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4147635

More information about the jboss-user mailing list