[jdom-interest] CDATA inconsistency

Duane Morin dmorin at lear.morinfamily.com
Thu Oct 31 19:03:58 PST 2002

I'm writing an email agent, and wanted to keep the headers in XML using 
JDOM.   But I've run into an interesting problem with a line that 
contains special characters. Actually, I can't even cut and paste the 
line because it screws up my editor.  In short, this Japanese 
spam has special characters in it that are very bad.

The *problem* is that JDOM allows me to create a CDATA object with this 
value, no problem.  But when I write out that XML and then try to read it 
back, I get an IllegalDataException on some of the special characters.

Is that right?  Should I be allowed to create the CDATA, write it, but 
then throw an exception when reading it back?  More useful to me, is there 
a way for me to prevent this at either end, such as by testing the 
validity of the CDATA section when I create it?


More information about the jdom-interest mailing list