To answer my own question, it looks like this is a known, open issue with a suggested partial fix:
http://issues.apache.org/jira/browse/XMLBEANS-274 > > From: <[EMAIL PROTECTED]> > Date: 2006/07/19 Wed AM 10:44:10 EST > To: <dev@xmlbeans.apache.org> > Subject: Bug with setLoadStripWhitespace ? Or expected behaviour? > > In addition to stripping insignificant white space between element close and > open tags, the setLoadStripWhitespace option will strip a space following an entity reference. > > So something saved as "Proctor & Gamble" is read as "Proctor &Gamble". > > This looks like a bug to me. Anyone know if this behaviour is intended? > > Here is a snippet to illustrate the problem: > > XmlObject test = XmlObject.Factory.parse("<company>Proctor & > Gamble</company>"); > System.out.println("test = " + test); > test.save(new File("test.xml")); > XmlObject test2 = XmlObject.Factory.parse(new File("test.xml")); > System.out.println("test2 = " + test2); > XmlOptions options = new XmlOptions().setLoadStripWhitespace(); > XmlObject test3 = XmlObject.Factory.parse(new File("test.xml"), > options); > System.out.println("test3 = " + test3); > > produces this output: > > test = <company>Proctor & Gamble</company> > test2 = <company>Proctor & Gamble</company> > test3 = <company>Proctor &Gamble</company> > > Cheers, > Gord > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]