I meant to say generating java classes from an xml schema (ant task).  Long 
day...
 


From: [email protected]
To: [email protected]
Subject: RE: [castor-user] [XML] How to omit <Narrative />?
Date: Tue, 21 Jul 2009 13:12:17 -0500



I am generating manually.  I just ran a test and if I set either 
nillable="true" or minOccurs="0", AND do not call setNarrative(null), then it 
omits the element.  Apparently setting null causes the <NARRATIVE /> but not 
calling the method at all leave it ommitted.
 
Thanks,
Andy
 

 
> Date: Tue, 21 Jul 2009 20:08:06 +0200
> From: [email protected]
> To: [email protected]
> Subject: Re: [castor-user] [XML] How to omit <Narrative />?
> 
> Andy,
> 
> are you generating Java classes from an XML schema, or are you mapping
> manually ?
> 
> Werner
> 
> Andy wrote:
> > 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
> 
> ---------------------------------------------------------------------
> 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.
_________________________________________________________________
NEW mobile Hotmail. Optimized for YOUR phone.  Click here.
http://windowslive.com/Mobile?ocid=TXT_TAGLM_WL_CS_MB_new_hotmail_072009

Reply via email to