[jdom-interest] CDATA inconsistency

Elliotte Rusty Harold elharo at metalab.unc.edu
Sun Nov 3 06:30:33 PST 2002

At 11:27 AM -0800 11/2/02, Malachi de AElfweald wrote:

>If you need to pass binary data, which you should be able to do 
>since XML is supposed
>to be cross-platform data,

No, you're not supposed to be able to do that. XML documents are 
based on text, not binary data. There is not even any requirement 
that the underlying representation of the text be binary numbers. 
Words written on paper are perfectly legal XML. So would data in a 
non-binary, analog computer, provided that its representation of text 
adhered to the XML spec.

>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).

All text in JDOM is Unicode text. It is not binary data. Changing it 
to a different encoding does not change whether it's legal or not. It 
just changes the binary representation of the text. When adding text 
to an element, for one example, you add a string, not an array of 

| Elliotte Rusty Harold | elharo at metalab.unc.edu | Writer/Programmer |
|          XML in a  Nutshell, 2nd Edition (O'Reilly, 2002)          |
|              http://www.cafeconleche.org/books/xian2/              |
|  http://www.amazon.com/exec/obidos/ISBN%3D0596002920/cafeaulaitA/  |
|  Read Cafe au Lait for Java News:  http://www.cafeaulait.org/      |
|  Read Cafe con Leche for XML News: http://www.cafeconleche.org/    |

More information about the jdom-interest mailing list