Hello,

 

We are working with XML Schemas and we have detected that, using Xerces' 
validation, there are some errors that don't appear if we use other tools to 
validate our schemas.

 

Errors happen when we have a base type that contains a choice particle followed 
by sequence or choice particles and we want to define a restricted type. Xerces 
only allow one element in those sequence or choice particles. But all the 
elements should be allowed.

 

This is an example:

 

-         This is the base type, that contains a choice particle followed by 
two sequence particles:

 

<xsd:complexType name="base">            

    <xsd:choice>

            <xsd:sequence minOccurs="0">                                        
      

                        <xsd:element name="a" type="xsd:string" minOccurs="0"/>

                        <xsd:element name="b" type="xsd:string" minOccurs="0"/>

                        <xsd:element name="c" type="xsd:string" minOccurs="0"/>

                        <xsd:element name="d" type="xsd:string" minOccurs="0"/>

                        <xsd:element name="e" type="xsd:string" minOccurs="0"/>

                        <xsd:element name="f" type="xsd:string" minOccurs="0"/>

                        <xsd:element name="g" type="xsd:string" minOccurs="0"/>

                        <xsd:element name="h" type="xsd:string" minOccurs="0"/>

                        <xsd:element name="i" type="xsd:string" minOccurs="0"/>

            </xsd:sequence>

             <xsd:sequence minOccurs="0">                                       
      

                        <xsd:element name="j" type="xsd:string" minOccurs="0"/>

                        <xsd:element name="k" type="xsd:string" minOccurs="0"/>

             </xsd:sequence>

    </xsd:choice>                

</xsd:complexType>

 

 

 

-         This is a restricted type that contains the same choice particle 
followed only by one of the sequence particles. Xerces find errors at this type.

 

<xsd:complexType name="restricted1"> 

   <xsd:complexContent>

        <xsd:restriction base="base">

            <xsd:choice>

                <xsd:sequence>

                    <xsd:element name="j" type="xsd:string"/>

                    <xsd:element name="k" type="xsd:string"/>

                </xsd:sequence>                        

            </xsd:choice>

         </xsd:restriction>

    </xsd:complexContent>

</xsd:complexType>

 

These are the errors that Xerces find:

rcase-MapAndSum.2: Group's occurrence range, (2,2), is not a valid restriction 
of base group's occurrence range, (1,1).

 

derivation-ok-restriction.5.4.2: Error for type 'restricted1'.  The particle of 
the type is not a valid restriction of the particle of the base.

 

 

-         This is another restricted type. Xerces doesn't find errors at it 
because the sequence particle only contains one element.

 

<xsd:complexType name="restricted2"> 

   <xsd:complexContent>

        <xsd:restriction base="base">

            <xsd:choice>

                <xsd:sequence>

                    <xsd:element name="j" type="xsd:string"/>                   
 

                </xsd:sequence>                        

            </xsd:choice>

         </xsd:restriction>

    </xsd:complexContent>

</xsd:complexType>

 

 

 

We believe this is caused by a Xerces' bug because we think that our schema is 
valid according to W3C Recommendation (http://www.w3.org/TR/xmlschema-1/ 
<http://www.w3.org/TR/xmlschema-1/> ). Could you tell us if we are right?

 

Thank you very much.

**********************************************************************************************
PAntes de imprimir este e-mail piense bien si es necesario hacerlo: El 
medioambiente es cosa de todos 

********************* Aviso Legal ********************* 
Este mensaje y cualquier fichero adjunto está dirigido únicamente a sus 
destinatarios 
 y contiene información confidencial. Si usted considera que ha recibido este 
correo 
electrónico por error (por el asunto, por el remitente o por cualquier otra 
causa), le 
informamos que cualquier revisión, alteración, impresión, copia o transmisión 
de este 
mensaje o de cualquier fichero adjunto está prohibida y puede constituir un 
acto ilegal. 
Por favor, notifíquele el error al remitente respondiendo a este e-mail y 
elimine 
el mensaje y su contenido inmediatamente. El Ministerio de Economía y Hacienda 
se 
reserva las acciones legales que le correspondan contra todo tercero que acceda 
de 
forma ilegítima al contenido de cualquier mensaje externo procedente del mismo. 

********************* Disclaimer ********************* 
This e-mail and any files transmitted with it are intended solely for the use 
of the 
intended recipients and may contain confidential information. If it appears 
(from the 
subject matter or address information or otherwise) that you received this 
email in error, 
please note that any review, dissemination, disclosure, alteration, printing, 
copying or 
transmission of this e-mail or any file transmitted with it is prohibited and 
may be 
unlawful. Please notify us by return email and delete this email and its 
contents 
immediately. Spanish Ministry of Finances may take any legal action, according 
with 
the illegal access to the content of any external message from the Ministry.

**********************************************************************************************

Reply via email to