Hi, I have tried using nillable="true" as well as minOccurs="0", but neither
seem to work.
<xs:element name="PERSON">
<xs:complexType>
<xs:sequence>
<xs:element name="FIRSTNAME" type="xs:string"/>
<xs:element name="LASTNAME" type="xs:string"/>
<xs:element name="DOB" type="xs:string" nillable="true"/>
<xs:element name="NARRATIVE" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
-Andy
> Date: Tue, 21 Jul 2009 09:50:04 +0200
> From: [email protected]
> To: [email protected]
> Subject: Re: [castor-user] [XML] How to omit <Narrative />?
>
> Hi,
>
> it all depends. Is this element required or optional ? In other words,
> if you had an XML schema, what would the element definition look like
> for this 'Narrative' element ?
>
> Regards
> Werner
>
> Andy wrote:
> > Hi, I have an element being generated by Castor named <Narrative>.
> > If I call setNarrative(null), I get --> <Narrative />. Is there a
> > flag I can set in Castor to either have the entire element omitted
> > from the XML or have it show <Narrative></Narrative>?
> >
> > Thanks!
> >
> > _________________________________________________________________
> > Windows Live™ Hotmail®: Celebrate the moment with your favorite
> > sports pics. Check it out.
> > http://www.windowslive.com/Online/Hotmail/Campaign/QuickAdd?ocid=TXT_TAGLM_WL_QA_HM_sports_photos_072009&cat=sports
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
> http://xircles.codehaus.org/manage_email
>
>
_________________________________________________________________
Windows Live™ Hotmail®: Celebrate the moment with your favorite sports pics.
Check it out.
http://www.windowslive.com/Online/Hotmail/Campaign/QuickAdd?ocid=TXT_TAGLM_WL_QA_HM_sports_photos_072009&cat=sports