Hi,
as JAXB does not escape special characters when marshaling, there exists
a solution to use a special EscapingXMLStreamWriter (see
http://blog.lesc.se/2009/03/escape-illegal-characters-with-jaxb-xml.html).
I used this in combination with
org.apache.commons.lang.StringEscapeUtils to replace the strings.
But I do not know how to replace the XMLStreamWriter used by
JaxbDataFormat with my implementation. Is there a way to tell the
JaxbDataFormat to use my EscapingXMLStreamWriter when marshaling?
The only other solution I could image is to define a Converter for the
data field and call it via the bindings.xjb. But that is just a workaround.
Thanks, Sven
- JaxbDataFormat & escaping special characters Sven Bauhan
-