Hi Nedim,
it's a known limitation of the current codebase: see https://issues.apache.org/jira/browse/XERCESC-1854 You can check if a character is valid according to XML 1.0 by using XMLChar1_0::isXMLChar. For XML 1.1, use XMLChar1_1::isXMLChar

Alberto

Il 03/01/2012 15:01, Nedim Srndic ha scritto:
Hello,

 is an invalid character reference in XML 1.0. If I write the byte
value "\x01" to a Xerces-C TextNode and serialize the entire DOMDocument
using UTF-8 and StdOutFormatTarget with XML version set to "1.0", then
Xerces-C writes the resulting XML document (without substituting the
character with the corresponding character reference) and doesn't report
any errors. Of course, the resulting XML is not well-formed and so I
cannot use it in other programs.

In XML 1.1 this character reference is allowed and Xerces-C correctly
performs the character substitution, but the software I am using these
documents with sadly still does not support XML 1.1.

Is there a Xerces-C function that I can call that will check if a string
that I want to put in an XML document satisfies the rules of
well-formedness for the given XML version? Is there something else I can
do about this problem? Why doesn't Xerces-C report the error?

Thank you,
Nedim Srndic


Reply via email to