Re: xsd:choice

Sounds like a job for type or element substitution.

Suggest you have a look at the best practice on
variable content containers if you haven't
already.

http://www.xfront.com/VariableContentContainers.pdf

Hopefully it will point you in the right direction.


Regards
Michael



                                                                                                                                             
                    Julie Schenk                                                                                                             
                    <schenkj@cisco.com        To:     xmlschema-dev@w3.org                                                                   
                    >                         cc:                                                                                            
                    Sent by:                  Subject:     xsd:choice                                                                        
                    xmlschema-dev-requ                                                                                                       
                    est@w3.org                                                                                                               
                                                                                                                                             
                                                                                                                                             
                    29/09/2001 09:03                                                                                                         
                    AM                                                                                                                       
                                                                                                                                             
                                                                                                                                             




Hello~

Is there a way to do something like xsd:choice when dealing with
an element's value, other than enumeration?  The reason I want to
do this is b/c I want the schema to proceed in different directions
depending on the element's value.  For example:

<PolicyType>IP</PolicyType>  where the PolicyType tag can have
many different values.  So I tried:

<xsd:element name="PolicyType">
      <xsd:complexType>
           <xsd:choice>
               <xsd:element name="IP" type="xsd:string"/>
               <xsd:element ref="PPP"/>
               <xsd:element ref="FrameRelay"/>

etc.

however this does not work b/c xsd:choice I believe examines tags.
Using enumeration doesn't work because each of the PolicyTypes is
actually itself an complexType.  So, if the PolicyType is IP, the schema
will proceed to <xsd:element name="IP" type="blah">.

Any input will be appreciated!

Thanks.

Julie








------------------------------------------
This e-mail is confidential.  If you are not the intended recipient, any use, disclosure or copying of this document is unauthorised and prohibited.  If you have received this document in error, please delete the email and notify me by return email or by phoning the NEMMCO Helpdesk on 1300 300 295.

Received on Saturday, 29 September 2001 08:00:43 UTC