Hallo 

i could localize the problem of converting <choice> to <sequence> in derivation 
by restriction problem:

if i define only:

<xs:complexType name="basis_typ">
                <xs:choice minOccurs="0" maxOccurs="unbounded">
                <xs:element name="foo" minOccurs="0" maxOccurs="unbounded"/>
                <xs:element name="bar" minOccurs="0" maxOccurs="unbounded"/>
        </xs:choice>
</xs:complexType>

to
        <xs:complexType name="derived_test_typ">
                <xs:complexContent>
                        <xs:restriction base="basis_typ">
                                        <xs:sequence>
                                                <xs:element name="foo" 
minOccurs="2" maxOccurs="2"/>
                                                <xs:element name="bar" 
minOccurs="4" maxOccurs="4"/>
                                        </xs:sequence>
                        </xs:restriction>
                </xs:complexContent>
        </xs:complexType>

all is fine an valid. But if i add an element before the <choice>-section i get 
errors:
<xs:complexType name="basis_typ">
        <xs:sequence>
                <xs:element name="added_element"/>
                <xs:choice minOccurs="0" maxOccurs="unbounded">
                        <xs:element name="foo" minOccurs="0" 
maxOccurs="unbounded"/>
                        <xs:element name="bar" minOccurs="0" 
maxOccurs="unbounded"/>
                </xs:choice>
        </xs:sequence>          
</xs:complexType>       
to
        <xs:complexType name="derived_test_typ">
                <xs:complexContent>
                        <xs:restriction base="basis_typ">
                                        <xs:sequence>
                                                <xs:element 
name="added_element"/>
                                                <xs:element name="foo" 
minOccurs="2" maxOccurs="2"/>
                                                <xs:element name="bar" 
minOccurs="4" maxOccurs="4"/>
                                        </xs:sequence>
                        </xs:restriction>
                </xs:complexContent>
        </xs:complexType>

i think this is a bug.

CU
Evgeny


>  -----Ursprüngliche Nachricht-----
> Von:  Usorov, Evgeny  
> Gesendet:     Freitag, 30. Juli 2004 14:00
> An:   '[EMAIL PROTECTED]'; 'xerces-j-dev@xml.apache.org'
> Betreff:      derivation by restriction and <choice> to <sequence>- definition
> 
> Hi,
> 
> Our company defines some XML-Intefaces for exchange eHealth-data. So our 
> global-schema-Standart 
> for all interfaces can be only restricted by the specific 
> XML-Schema-Interface. 
> But i get all the time problems when somebody wants to restrict the 
> global-schema. 
> 
> Situation:
> Our standart provider_typ, only short-cut
>       <xs:complexType name="provider_typ">
>               <xs:sequence>
>                       <!-- here some other elements like provider.type_cd, 
> that are not relevant for this example-->
>                       <xs:choice maxOccurs="unbounded">
>                               <xs:element ref="person"/>
>                               <xs:element ref="organization"/>
>                       </xs:choice>
>               </xs:sequence>
>       </xs:complexType>
> 
> So with that type I can have 3 persons, who belongs to 1 organization. Now 
> somebody 
> wants to define specific schema for doctors, like one group practice can have 
> many doctors. So here the specific_provider_typ
> 
>       <xs:complexType name="specific_provider_typ">
>               <xs:complexContent>
>                       <xs:restriction base="provider_typ">
>                               <xs:sequence>
>                                       <!-- here other specific elements, that 
> are not relevant for this example-->
>                                       <xs:element ref="person" minOccurs="0" 
> maxOccurs="unbounded"/>
>                                       <xs:element ref="organization"/>
>                               </xs:sequence>
>                       </xs:restriction>
>               </xs:complexContent>
> </xs:complexType>
> 
> So now in this specific_provider_typ I changed <choice> to <sequence>, now 
> there have 
> to be one organization and may be some persons. I think from the XML-view 
> this is a 
> valid restriction. 
> But Xerces (2.6.2) reports an error:
> [Error] test.xsd:129:47: rcase-Recurse.2: There is not a complete functional 
> mapping between the particles.
> [Error] test.xsd:129:47: derivation-ok-restriction.5.4.2: Error for type 
> 'specific_provider_typ'.  The particle of the type is not a valid restriction 
> of the particle of the base.
> 
> Is it not allowed to change from <choice> to <sequence> or this is Xerces bug 
> ? 
> I tryed other ways to define global-schema, but without success. Only thing 
> that works is to define in the global-schema normal <sequence> without 
> <choice>.> 
> 
> Can somebody help ?
> Thanks in advance
> Evgeny Usorov
> www.kbv.de

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

Reply via email to