users@jaxb.java.net

Possible JAXB marshalling bug for XML 'character references'?

From: Wagle, Shriniwas <wagle_shriniwas_at_bah.com>
Date: Wed, 25 Jul 2007 13:02:00 -0400

Using JAXB, I'm creating an XML element and setting it's value using the
"setValue (String value)" method.
 
The value contains a combinations of some regular text characters
intermixed with \u000d (CR) and \u000a (LF) characters.
 
If I specify the value, for example, as a.setValue ("abc&#13;&#10;def"),
when I marshall the XML, it replaces the & with &amp;. So the resultant
output becomes "abc&amp#13;&amp#10;def". This makes the output entirely
different from what it ought to be.
 
To me this clearly seems to be incorrect behavior. I would have
expected JAXB to marshall character references as is, without changing
the & of a character reference to &amp;
 
Is there any option etc. to control this behavior?
 
Thank you.