users@jaxb.java.net

RE: Re: White Spaces in xsd:string

From: Marchi, Ron <marchir_at_ugs.com>
Date: Tue, 7 Jun 2005 15:13:13 -0500

Kohsuke,

I very much appreciate the effort for resolving this in JAXB 2.0.
However for those of us who can no wait for the 2.0 release, I have
found a solution for use in JAXB 1.0.

The JAXB FAQs
        https://jaxb.dev.java.net/faq/index.html#marshalling_cdata
describes how to use the Xerces XMLSerializer class to wrap text data in
CDATA tags. This approach to serialization can be used to take advantage
of the Xerces OutputFormat.setPreserveSpace method to encode the Line
Feed and Tab characters in attribute values.

There is one caveat to this solution; older versions of Xerces have the
same shortcomings with respect to attribute line feeds. This approach
works with Xerces 2.6.2, but did not with Xerces 1.4.0.


Regards
Ron


-----Original Message-----
From: Kohsuke Kawaguchi [mailto:Kohsuke.Kawaguchi_at_Sun.COM]
Sent: Monday, May 16, 2005 1:10 PM
To: users_at_jaxb.dev.java.net
Subject: Re: White Spaces in xsd:string

Kohsuke Kawaguchi wrote:
> You can file a bug if you want to know when this gets implemented.
> Otherwise you can come back and pick up a build to see if it works.

Fixed in the repository. This change will show up in the next Monday's
weekly.

-- 
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com