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 &amp; 
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 &amp; Gamble</company>
test2 = <company>Proctor &amp; Gamble</company>
test3 = <company>Proctor &amp;Gamble</company>

Cheers,
Gord


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to