[prev in list] [next in list] [prev in thread] [next in thread]
List: xmlbeans-user
Subject: RE: How to prevent xsi:nil="true" from being created
From: Christopher.Mathrusse () sybase ! com
Date: 2007-01-09 16:25:10
Message-ID: OF7443F2D9.AEF457E8-ON8825725E.005A3123-8825725E.005A31AF () sybase ! com
[Download RAW message or body]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META boundary="----=_Part_81741_15540462.1168320719605" alternative; multipart
Content-Type:>
<META http-equiv=Content-Type content="text/html; charset=us-ascii"
Content-Type: ------="_Part_81741_15540462.1168320719605" inline
Content-Disposition: html; text 7bit Content-Transfer-Encoding:>
<META content="MSHTML 6.00.5730.11" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=352521716-09012007><FONT face=Arial
color=#0000ff size=2>This problem, per the documentation, is attributed to
calling a setXXX method on your XmlBean objects and assigning a null value. If
you don't want the elements to appear in your document then you should not call
the setXXX method passing in a null. If the null has been assigned and you do
not want the element to appear in the document you need to invoke the unsetXXX
method. While this make sense to me it is damn inconvenient. I wish that there
were an XmlOption that I could apply that would remove empty elements from the
document. </FONT></SPAN></DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> Ran <ran256@gmail.com> [mailto:Ran
<ran256@gmail.com>] <BR><B>Sent:</B> Monday, January 08, 2007 9:32
PM<BR><B>To:</B> user@xmlbeans.apache.org<BR><B>Subject:</B> Re: How to prevent
xsi:nil="true" from being created<BR></FONT><BR></DIV>
<DIV></DIV>I m looking for the same solution as well, best i can do now is to
put empty string for null records.<BR>Let me know if you found
anything.<BR>Thanks,<BR>ran<BR><BR>
<DIV><SPAN class=gmail_quote>On 1/8/07, <B class=gmail_sendername><A
href="mailto:Christopher.Mathrusse@sybase.com">Christopher.Mathrusse@sybase.com</A></B>
<<A
href="mailto:Christopher.Mathrusse@sybase.com">Christopher.Mathrusse@sybase.com</A>>
wrote:</SPAN>
<BLOCKQUOTE class=gmail_quote
style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
<DIV>
<DIV><SPAN><FONT face=Arial size=2>I am creating a new XmlObject from the
factory method. I'm adding the appropriate objects throughout the document but
some of the elements are defined as optional per the schema. When I am done
composing the document and I save/parse the document the optional elements are
place into the document as follows:</FONT></SPAN></DIV>
<DIV><SPAN><FONT face=Arial size=2><ContactInformation xsi:nil="true"
xmlns:xsi="<A onclick="return top.js.OpenExtLink(window,event,this)"
href="http://www.w3.org/2001/XMLSchema-instance%22/" target=_blank>
http://www.w3.org/2001/XMLSchema-instance"/</A>></FONT></SPAN></DIV>
<DIV><SPAN><FONT face=Arial size=2></FONT></SPAN> </DIV>
<DIV><SPAN><FONT face=Arial size=2>How do I eliminate these elements from
appearing in the document?</FONT></SPAN></DIV>
<DIV><SPAN><FONT face=Arial size=2></FONT></SPAN> </DIV>
<DIV><SPAN><FONT face=Arial size=2>Thanks....</FONT></SPAN></DIV>
<DIV> </DIV>
<DIV align=left><FONT face=Arial size=2>Chris Mathrusse</FONT></DIV>
<DIV align=left><FONT face=Arial size=2><A
onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:christopher.mathrusse@sybase.com"
target=_blank>christopher.mathrusse@sybase.com</A></FONT></DIV>
<DIV align=left><FONT face=Arial size=2>(925) 236-5553</FONT></DIV>
<DIV> </DIV></DIV>---------------------------------------------------------------------
To unsubscribe, e-mail: <A
onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:user-unsubscribe@xmlbeans.apache.org"
target=_blank>user-unsubscribe@xmlbeans.apache.org</A> For additional
commands, e-mail: <A onclick="return top.js.OpenExtLink(window,event,this)"
href="mailto:user-help@xmlbeans.apache.org"
target=_blank>user-help@xmlbeans.apache.org</A>
</BLOCKQUOTE></DIV><BR></BODY></HTML>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic