[jdom-interest] CDATA inconsistency

Alex Rosen arosen at novell.com
Wed Nov 27 07:48:32 PST 2002

A CDATA section can contain any string of legal XML characters other than ]]>. It sounds like  you're trying to put in illegal XML characters, because you're obtaining the string using the wrong character encoding. The characters aren't bad in their encoding, but they're bad (i.e. mistranslated into bad characters) due to how you're obtaining them.


10/31/2002 7:03:58 PM, Duane Morin <dmorin at lear.morinfamily.com> wrote:

>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?
>To control your jdom-interest membership:

To control your jdom-interest membership:

More information about the jdom-interest mailing list