[jdom-interest] CDATA inconsistency

Malachi de AElfweald malachi at tremerechantry.com
Fri Nov 1 22:25:33 PST 2002


I don't think that is technically accurate...

the character '<' is not a valid XML character
unless you escape it '&lt;'

But, it is valid inside a CDATA, because a CDATA is
supposed to be unparsed data.

You are correct that anything other than ']]>' should be
legal, just commenting on the "legal XML characters"...

Malachi


11/27/2002 7:48:32 AM, "Alex Rosen" <arosen at novell.com> wrote:

>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.
>
>Alex
>
>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?
>>
>>DUane
>>
>>
>>_______________________________________________
>>To control your jdom-interest membership:
>>http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhost.com 
>>
>>
>
>
>
>_______________________________________________
>To control your jdom-interest membership:
>http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhost.com
>
>_______________________________________________
>To control your jdom-interest membership:
>http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhost.com
>
>






More information about the jdom-interest mailing list