Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: Particle Restriction Elt:Elt -- NameAndTypeOK

From: Zafar Abbas <Zafar.Abbas@---------.--->
To: Koen Van Oost <koen.vanoost@------.-->, <xmlschema-dev@--.--->
Date: 10/9/2006 5:23:00 AM
You are getting an error since the type of the local particle
EmployerClass is not a valid restriction of the type of the globally
declared element EmployerClass. Even though they are both derived from
xs:int , it still does not make one valid restriction of the other. Your
solution of creating base and derived simple types works since it
follows the rules of valid type derivation.

 

Thanks.

 

 

________________________________

From: xmlschema-dev-request@w... [mailto:xmlschema-dev-request@w...]
On Behalf Of Koen Van Oost
Sent: Wednesday, October 04, 2006 11:30 AM
To: xmlschema-dev@w...
Subject: Particle Restriction Elt:Elt -- NameAndTypeOK

 

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



transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent