users@jaxb.java.net

Re: marshalling invalid XML?

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Thu, 27 May 2004 08:35:35 -0700

> I've noticed that the following behavior can occur:
>
> Using JAXB I marshall a content tree. There's an element (xs:string)
> which has been filled with characters including an ASCII 0x2, and 0x6.
> This marshalls fine.

The marshaller doesn't check if the XML it is producing is well-formed
or valid. Those control characters aren't allowed in XML.


> I really don't know much about encodings so I hope someone can help me
> shed some light on this. I'm not sure if JAXB should be marshalling this
> content, or rather if it should be able to unmarshall it. I do know that
> if JAXB writes it, it should also read it.

I guess one can argue that it should check the well-formedness at least.
I think the only check that we *don't* do wrt the well-formedness is
those control character checks, but those are relatively expensive and
could affect the performance.


regards,
--
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
For additional commands, e-mail: users-help_at_jaxb.dev.java.net