[jdom-interest] CDATA inconsistency

Malachi de AElfweald malachi at tremerechantry.com
Sat Nov 2 11:27:13 PST 2002

It seems that you should be allowed to enter any data... Then, during output,
you should be choosing the appropriate encoding...  For example, Kanji (sp)
characters should be allowed -- but if you output as ISO-8859-1, it should give

If you need to pass binary data, which you should be able to do since XML is supposed
to be cross-platform data, might need to be converted into something readable. For
example, using UUENCODE to make sure that it is transmittable over HTTP.

But, I don't think you should be prevented from adding data, as it *could* be valid
given a particular charset encoding (especially since you can make custom charsets).


11/2/2002 9:45:08 AM, Duane Morin <dmorin at morinfamily.com> wrote:

>At 11:47 AM 11/2/2002 -0500, bob mcwhirter wrote:
>>I would like to take this opportunity to remind everyone that MIME exists
>>for a reason.  When all you have a is a hammer (XML) everything looks like
>>a thumb (stuffing random binary in XML).
>In  my defense, the original question wasn't "What's a way to get around 
>this?" but rather on the apparent inconsistency in the fact that I could 
>create the CDATA object, write it out, but then when I tried to read it 
>back in, I got IllegalData.  I agree completely that I should never have 
>tried to put it into XML in the first place. The program I wrote is just 
>taking existing text and trying to stuff it into an Element, and I hadn't 
>considered international characters.  I thought that if the CDATA 
>constructor threw an exception or something, or otherwise told me that I 
>had invalid data, then I could catch it and act accordingly before writing 
>it out.  Otherwise I have to test everything before putting it into the 
>Element, even though maybe 1% or less of my data will fit this condition.
>>         -bob
>>To control your jdom-interest membership:
>To control your jdom-interest membership:

More information about the jdom-interest mailing list