Right now, the more verbose code that you posted is the only way to get
what you want.

Radu

On Mon, 2008-01-28 at 21:06 +0100, Veit Guna wrote:
> Hi all.
> 
> I'm encountering the same problem explained in here:
> 
> http://www.mail-archive.com/[email protected]/msg00541.html
> 
> As soon as I call setFoo(null) on Bar the xml output looks like
> 
> <bar foo=""/>
> 
> If I leave the set out, it renders like this:
> 
> <bar/>
> 
> Since I'm copying several attributes from my domain model from/to the 
> xmlbeans I'm searching for a way to let xmlbeans handle set(null) as 
> unset. I would like to avoid the
> 
> if {bo.getFoo() != null) {
>       xb.setFoo(bo.getFoo());
> }
> 
> construct for _every_ attribute. Always setting null to "" in xml is a 
> bit noisy for me.
> 
> Is there any way to achieve this? Perhaps something like XmlOptions or 
> similar?
> 
> Regards,
> Veit
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

Notice:  This email message, together with any attachments, may contain 
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated 
entities,  that may be confidential,  proprietary,  copyrighted  and/or legally 
privileged, and is intended solely for the use of the individual or entity 
named in this message. If you are not the intended recipient, and have received 
this message in error, please immediately return this by email and then delete 
it.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to