[jdom-interest] CDATA inconsistency
Duane Morin
dmorin at lear.morinfamily.com
Fri Nov 1 07:58:46 PST 2002
Is this the right behavior, is what I'm asking. I am allowed to create a
CDATA with those illegal characters. I assume that this is because
you can't real fail a constructor nicely in Java. Should there be a way
that I can tell immediately that I've got bad characters on my hands?
Duane
On Wed, 27 Nov 2002, Alex Rosen 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
>
More information about the jdom-interest
mailing list