What Jacob says. I'd like to emphasize two things:
 
1. It's not desireable that XMLBeans prevents you from creating invalid
content, here's why
<complexType name="foo">
    <sequence>
        <element name="a"/>
        <element name="b"/>
    </sequence>
</complexType>
 
If you start with an empty "foo" and add and "a", it's invalid because
there's a "b" required. If you start by adding a "b", it's invalid
because it's not preceded by an "a". So you're deadlocked.
 
2. XMLBeans gives you the ability to call 'validate' on an XmlObject
without having to serialize it to XML, which is something that is, I
believe, unique to XMLBeans.
 
So I think you have the tools to create valid documents.
 
Radu


________________________________

        From: Jacob Danner [mailto:[EMAIL PROTECTED] 
        Sent: Wednesday, January 09, 2008 9:59 AM
        To: user@xmlbeans.apache.org
        Subject: Re: XMLBeans handling of <choice>
        
        
        I don't think XMLBeans will do anything to "PREVENT" you from
doing this, however when you go to validate things will most likely
fail.
        -jacobd
        
        
        On Jan 9, 2008 9:00 AM, < [EMAIL PROTECTED]>
wrote:
        


                This question could also be applied to other Schema
types. 
                
                I'd like to know if the Java types produced by the
generator corresponding to a <choice> type in a schema would PREVENT me
from setting the member of an object to a combination of elements that
the choice is declaring as mutually exclusive? 
                
                Example includes the schema and the generated classes. 
                
                In the example in a choice I have childA and childB. It
looks like the implementation class for the containing element is
agnostic to whether i set one or both of these children. 
                
                
                
                
                Jeff Saremi 

                THIS EMAIL COMMUNICATION IS INTENDED ONLY FOR THE PERSON
OR ENTITY TO WHICH IT IS ADDRESSED AND MAY CONTAIN CONFIDENTIAL AND/OR
PRIVILEGED INFORMATION. ANY USE OF THIS INFORMATION BY PERSONS OR
ENTITIES OTHER THAN THE INTENDED RECIPIENT IS PROHIBITED. IF YOU
RECEIVED THIS IN ERROR, PLEASE CONTACT THE SENDER AND DELETE THE EMAIL
AND ALL COPIES (ELECTRONIC OR OTHERWISE) IMMEDIATELY. 

                

                 

                CE COURRIEL EST DESTINE UNIQUEMENT A LA PERSONNE OU A
L'ENTITE A LAQUELLE IL EST ENVOYE ET PEUT CONTENIR DE L'INFORMATION
CONFIDENTIELLE OU PRIVILEGIEE. TOUTE UTILISATION DE L'INFORMATION PAR
UNE PERSONNE OU UNE ENTITE AUTRE QUE CELLE A LAQUELLE ELLE EST DESTINEE
EST INTERDITE. SI VOUS RECEVEZ CE COURRIEL PAR ERREUR, VEUILLEZ
COMMUNIQUER AVEC SON EXPEDITEUR ET SUPPRIMER CE COURRIEL ET TOUTE COPIE
(ELECTRONIQUE OU AUTRE) IMMEDIATEMENT. 

                 


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



Notice:  This email message, together with any attachments, may contain 
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated 
entities,  that may be confidential,  proprietary,  copyrighted  and/or legally 
privileged, and is intended solely for the use of the individual or entity 
named in this message. If you are not the intended recipient, and have received 
this message in error, please immediately return this by email and then delete 
it.

Reply via email to