I will now officially (meaning in JIRA ;-) ) add this feature request to the 
list, it's come up before.

Thanks,
Radu

-----Original Message-----
From: Springer, Ian P. [mailto:[EMAIL PROTECTED]
Sent: Tuesday, May 24, 2005 7:48 AM
To: dev@xmlbeans.apache.org
Subject: RE: All elements not appearing in the generated XML


I think it would make sense for XMLBeans to automatically add a
simple-type element if it has a minOccurs>0 and a default or fixed value
(or provide an option to enable this behavior). It could save the
developer a lot of initialization code when building up a document.

Ian

| -----Original Message-----
| From: Radu Preotiuc-Pietro [mailto:[EMAIL PROTECTED] 
| Sent: Monday, May 23, 2005 6:37 PM
| To: dev@xmlbeans.apache.org
| Subject: RE: All elements not appearing in the generated XML
| 
| Actually, no, it won't. Since there is a difference between 
| an element being present with the default value and an 
| element not being present, the behavior of xmlBeans is to 
| just not add any elements by itself, without the user 
| requesting it explicitly.
| I don't understand why you would modify your Schema to add
|     ... default="red"
| rather than modify your Java code to add
|     ... x.addNewColor()
| 
| Radu
| 
| -----Original Message-----
| From: Springer, Ian P. [mailto:[EMAIL PROTECTED]
| Sent: Monday, May 23, 2005 8:06 AM
| To: dev@xmlbeans.apache.org
| Subject: RE: All elements not appearing in the generated XML
| 
| 
| Have you tried setting default or fixed values in your schema? e.g.:
| 
| <xs:element name="Color" type="xs:string" default="red"/> 
| <xs:element name="Color" type="xs:string" fixed="red"/> 
| 
| I'm not sure if XMLBeans automatically instantiates 
| subelements that have default or fixed values, but I would 
| hope that it either automatically does or provides an option to do so.
| 
| Ian
| 
| | -----Original Message-----
| | From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
| | Sent: Sunday, May 22, 2005 3:43 AM
| | To: dev@xmlbeans.apache.org
| | Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
| | Subject: All elements not appearing in the generated XML
| | 
| | Hi
| | 
| | We need all the elements that are defined in the XSD to 
| appear in the 
| | XML.
| | Using xmlBeans we specifically set certain elements  & hence those 
| | elements appear in the XML. The elements which are not 
| explicitly set 
| | using xmlBeans does not appear in the XML. Is there a way (xsd 
| | indicator) in the XSD to enforce a particular element to 
| appear in the 
| | XML even if it does not hold any value?
| | 
| | Could you pls help me on this?
| | 
| | Regards,
| | -----------------------------------------------------------------
| | Rajshree Lenin
| | Extension : 706.
| | ------------------------------------------------------------------
| | Important Email Information :- The  information  in  this email is 
| | confidential and may  be  legally  privileged. It is  
| intended  solely 
| | for the addressee. Access to  this email  by anyone  else  is  
| | unauthorized.  If you are not the intended recipient, any 
| disclosure, 
| | copying, distribution or any action taken or omitted to be taken in 
| | reliance on it, is prohibited and may be unlawful. If you 
| are not the 
| | intended addressee please contact the sender and dispose of this 
| | e-mail immediately.
| | 
| | 
| | 
| ---------------------------------------------------------------------
| | To unsubscribe, e-mail: [EMAIL PROTECTED]
| | For additional commands, e-mail: [EMAIL PROTECTED]
| | 
| | 
| 
| ---------------------------------------------------------------------
| To unsubscribe, e-mail: [EMAIL PROTECTED]
| For additional commands, e-mail: [EMAIL PROTECTED]
| 
| 
| ---------------------------------------------------------------------
| To unsubscribe, e-mail: [EMAIL PROTECTED]
| For additional commands, e-mail: [EMAIL PROTECTED]
| 
| 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to