You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by Rob Harrington <ro...@yahoo.com> on 2004/08/16 23:46:07 UTC

empty elements

I am new.  Apologies if this is easily found elsewhere
or already answered here.  I have looked.

I have something like this in my schema:

<xs:element name="IO">
  <xs:complexType>
    <xs:all>
    <xs:element name="purchaseOrderNo"
type="xs:string" minOccurs="0"/>
    </xs:all>
  </xs:complexType>
</xs:element> 

When parsing an xml doc, it seems to be ok if the
purchaseOrderNo element doesn't exist (tags and all),
which is what I'd prefer.  When trying to create the
xml (ie from db values), if the db value is null I'd
very much like not to see the purchaseOrderNo element
(tags and all).  But currently I'm getting this:

<purchaseOrderNo xsi:nil="true"/>

Similarly, if the db value is "" (empty java String),
I'd also like to see no tag for this, but I get:

<purchaseOrderNo/>

Is there a way around this?  I have alot of these
elements, and most are not required to have info.  I'd
like to avoid the verbosity over the wire if possible.

Thanks.


		
_______________________________
Do you Yahoo!?
Express yourself with Y! Messenger! Free. Download now. 
http://messenger.yahoo.com

- ---------------------------------------------------------------------
To unsubscribe, e-mail:   xmlbeans-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xmlbeans-user-help@xml.apache.org
Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/