cgbusch said:
"Character reference "&#c" is an invalid XML character"
With JDOM and Xerces in Java, I get the above error with sequences.
That's right. You can't put that character in an XML 1.0 document
even by using a character reference. (Why is there this restriction?
The usual answer is that XML is a text format, not a binary format.)
I need to be able to encode arbitrary char sequences in xml.
You'll have to really encode them, and translate them back again in
your application. If you just need to represent ascii characters
including controls, you could use some other Unicode characters
such as the private use characters (this would make translation
easy). Or you could encode everything using, say, base-64. Or
you could use an element to represent the illegal characters,
something like <char code="12"/>.
-- Richard