users@jaxb.java.net

Re: validation problems with whitespace in xml-files

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Tue, 16 Jan 2007 12:49:55 -0800

karloh wrote:
> hi,
>
> i use java 1.5 and jaxb 2. when i try to validate my xml-files there is a
> problem with elements like this:
>
> <item height="5" width="3">
> </item>
>
> Because of the newline there is a validation error, that no characters are
> allowed in the element "item". as i'm not allowed to change the xml-files,
> does anyone know how to solve this problem?

Sounds like you are using a broken validator. Tell whoever implemented
it that they need to handle whitespace normalization.

But more importantly, I thought JAXB is smart enough to generate <item
... /> How did you invoke the marshaller?

-- 
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com