You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomee.apache.org by Manu George <ma...@gmail.com> on 2007/01/11 11:06:07 UTC

Whitespaces not getting removed.

Hi,
    When the deployment descriptor entries are populated into the
corresponding objects, the white spaces tabs newlines etc are not
getting stripped off. Since JAXB is being used for population do we
need to set some setting to strip whitespace eg using xs:token instead
of xs:String in the schema? OR do we need to manually do it by calling
trim when we populate the info objects?

Thanks
Manu

Re: Whitespaces not getting removed.

Posted by Dain Sundstrom <da...@iq80.com>.
On Jan 11, 2007, at 2:06 AM, Manu George wrote:

> Hi,
>    When the deployment descriptor entries are populated into the
> corresponding objects, the white spaces tabs newlines etc are not
> getting stripped off. Since JAXB is being used for population do we
> need to set some setting to strip whitespace eg using xs:token instead
> of xs:String in the schema? OR do we need to manually do it by calling
> trim when we populate the info objects?


Looks like we can use XmlAdapter (http://java.sun.com/javaee/5/docs/ 
api/javax/xml/bind/annotation/adapters/XmlAdapter.html).  At first it  
looks like you have to set this on every String attribute, but  
according to this blog post you can set it at the package level:

http://weblogs.java.net/blog/kohsuke/archive/2005/09/using_jaxb_20s.html

-dain