Description
Solution for XERCESC-1854 introduced method
DOMLSSerializerImpl::ensureValidString
which has an error in validation.
The method validates XMLCh which represent UTF16.
Valid Characters #x9 | #xA | #xD | x20-#xD7FF | xE000-#xFFFD | x10000-#x10FFFF
are the valid UTF32 characters.
The UTF16 surrogate range from xD800 - xDFFF is used to represent x10000-#x10FFFF and should not be handled as nvalid.
The reader threads this correctly and does not complain, which leads to an asmetric behavior
Reading DOM => OK
Save back DOM => Exception
I tried to attach an example to show the behavior.
The used methods
bool XMLChar1_1::isXMLChar(const XMLCh toCheck, const XMLCh toCheck2)
already have a second optional parameter to check surrogate values.