W3C home > Mailing lists > Public > xmlschema-dev@w3.org > October 2006

Particle Restriction Elt:Elt -- NameAndTypeOK

From: Koen Van Oost <koen.vanoost@online.be>
Date: Wed, 4 Oct 2006 20:29:38 +0200
To: <xmlschema-dev@w3.org>
Message-ID: <009f01c6e7e3$0cee63e0$03b5a8c0@LOEBAS2003>
Hi,

 

I have an invalid XSD schema due to an incorrect particle restriction.

Still I cannot explain why this is.

Can somebody help me.

 

We need to modify the EmployerClass definition since it changed.

(In the real live the EmployerClass definition is included in another xsd)

 

I manage to get it right if I create a EmployerClass simpleType and then
restrict this.

Is there no other way?

 

<?xml version="1.0" encoding="UTF-8"?>

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" attributeFormDefault="unqualified">

            <xs:complexType name="EmployerType">

                        <xs:annotation>

                                   <xs:documentation
xml:lang="FR">Employeur</xs:documentation>

                                   <xs:documentation
xml:lang="NL">Werkgever</xs:documentation>

                        </xs:annotation>

                        <xs:sequence>

                                   <xs:element ref="EmployerID"/>

                                   <xs:element ref="EmployerClass"
minOccurs="0"/>

                        </xs:sequence>

            </xs:complexType>

            <xs:element name="EmployerClass">

                        <xs:annotation>

                                   <xs:documentation xml:lang="FR">Categorie
de l'employeur</xs:documentation>

                                   <xs:documentation
xml:lang="NL">Werkgevercategorie</xs:documentation>

                                   <xs:documentation
source="KszBcssGlossary">120001</xs:documentation>

                        </xs:annotation>

                        <xs:simpleType>

                                   <xs:restriction base="xs:int">

                                               <xs:minInclusive value="0"/>

                                               <xs:maxInclusive
value="9999"/>

                                   </xs:restriction>

                        </xs:simpleType>

            </xs:element>

            <xs:complexType name="EmployerIDType">

                        <xs:sequence>

                                   <xs:element name="NOSSRegistrationNbr"
minOccurs="0"/>

                        </xs:sequence>

            </xs:complexType>

            <xs:element name="EmployerID" type="EmployerIDType">

                        <xs:annotation>

                                   <xs:documentation
xml:lang="FR">Identification de l'employeur</xs:documentation>

                                   <xs:documentation
xml:lang="NL">Identificatie van het werkgever</xs:documentation>

                                   <xs:documentation
source="KszBcssGlossary">121000</xs:documentation>

                        </xs:annotation>

            </xs:element>

            <xs:element name="Test">

                        <xs:complexType>

                                   <xs:sequence>

                                               <xs:element name="Activity"
minOccurs="0" maxOccurs="5">

                                                           <xs:complexType>

 
<xs:sequence>

 
<xs:element name="Employer" minOccurs="0">

 
<xs:complexType>

 
<xs:complexContent>

 
<xs:restriction base="EmployerType">

 
<xs:sequence>

 
<xs:element ref="EmployerID"/>

 
<xs:element name="EmployerClass" minOccurs="0">

 
<xs:annotation>

 
<xs:documentation>Categorie de l employeur</xs:documentation>

 
</xs:annotation>

 
<xs:simpleType>

 
<xs:restriction base="xs:int">

 
<xs:minInclusive value="0"/>

 
<xs:maxInclusive value="999"/>

 
</xs:restriction>

 
</xs:simpleType>

 
</xs:element>

 
</xs:sequence>

 
</xs:restriction>

 
</xs:complexContent>

 
</xs:complexType>

 
</xs:element>

 
</xs:sequence>

                                                           </xs:complexType>

                                               </xs:element>

                                   </xs:sequence>

                        </xs:complexType>

            </xs:element>

</xs:schema>

 

Thanks,

Koen
Received on Thursday, 5 October 2006 02:58:11 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:55 GMT