users@jaxb.java.net

RE: Re: White Spaces in xsd:string

From: Marchi, Ron <marchir_at_ugs.com>
Date: Fri, 13 May 2005 12:57:27 -0500

This portion of the XML Spec (http://www.w3.org/TR/REC-xml/#AVNormalize)
is describing how white space should be handled while parsing a XML
document, specifically convert tabs and line feeds .etc to a single
space character. The best I can tell is that JAXB and/or the underlying
SAX/DOM parsers (Xerces) are doing exactly what the spec says.

The answer to your question is yes. Could or should JAXB encode the line
feeds to &#xA; in attribute values when marshalling a JAXB object?

I am not sure what the spec says about printing these encoded values in
the attributes, or what can of worms this might open up. But the XML
parsers I have worked with already de-code the &#xA; to line feeds when
encountered in an attribute value.


Thanks
Ron


-----Original Message-----
From: Kohsuke Kawaguchi [mailto:Kohsuke.Kawaguchi_at_Sun.COM]
Sent: Thursday, May 12, 2005 10:04 AM
To: users_at_jaxb.dev.java.net
Subject: Re: White Spaces in xsd:string

Marchi, Ron wrote:
> As I read the XML spec, these characters are permitted in the
attribute value,
> but must be normalized (converted to &#10;).
> If so wouldn't that be the responsibility of the JAXB marshaller?

You mean, JAXB should print &#xA; and so on to make sure that they can
be read back correctly?

-- 
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com