From an e-mail to the XOM-interest mailing list:
Eamonn O'Brien-Strain:
> >Just like attribute values, it is OK to pass in
arbitrary text. The
> >toXml() serializer will either encode the text or
enclose it in
> ><![CDATA[ ... ]]>
Elliotte Rusty Harold :
> No, there are characters which are legal in Java
strings, but which
> are illegal in XML content. These include the C0
controls (which some
> developers do actually try to use), unmatched halves
of surrogate
> pairs, and 0xFFFE and 0xFFFF.
We should test these cases to see if they result in bad
XML being serialized to bytes or whether the Java
byte<->char conversions handle things properly. If we
find a case of creating bad XML we should either fix
it, or document clearly a precondition of the methods
that disallows such text.
Logged In: YES
user_id=266403
There is a typo in the title. It should be "Test creation
of bad XML text".