I guess you can achieve this with a custom PrePostSet extension ? Jacob Danner just posted a link to an interesting article: http://www.ibm.com/developerworks/xml/library/x-xmlbeanse/?S_TACT=105AGX54&S_CMP=B0201&ca=dnw-904
Would it work to restore the oldValue when the newValue is null ? Or even better: to return false from the postSet method ? The postSet method returns void according to http://wiki.apache.org/xmlbeans/PrePostSetFeature but in the article it returns a boolean ? Maarten On Jan 28, 2008 10:28 PM, Radu Preotiuc-Pietro <[EMAIL PROTECTED]> wrote: > 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] > >

