Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: Resctriction problem on complexType

From: "Michael Kay" <mike@--------.--->
To: "'Bruno Chatel'" <bcha@-------.--->, <xmlschema-dev@---.--->
Date: 7/13/2006 4:14:00 PM
Your restricted type allows an art1 element followed by an s1 element. The
base type doesn't allow this. It's invalid to define a restricted type that
allows content that the base type doesn't permit.

Michael Kay
http://www.saxonica.com/
 

> -----Original Message-----
> From: xmlschema-dev-request@w... 
> [mailto:xmlschema-dev-request@w...] On Behalf Of Bruno Chatel
> Sent: 13 July 2006 15:03
> To: xmlschema-dev@w...
> Cc: Pierre Attar; Bruno Chatel
> Subject: Resctriction problem on complexType
> 
> 
> Hi,
> 
> I have an error wuth the following schema using a restriction 
> of a complexType.
> 
> The schema is not valid using different tools (SQC, XSDValid, 
> Xerces, XmlSpy)...
> But the error messages are not really understandable.
> 
> The aim is ti defne a restricted type by setting minOccurs to 
> 1 to included choices.
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" 
> elementFormDefault="qualified" attributeFormDefault="unqualified">
>  <xs:complexType name="essai">
>       <xs:choice>
>            <xs:choice minOccurs="0" maxOccurs="unbounded">
>                 <xs:element ref="art1"/>
>                 <xs:element ref="art2"/>
>            </xs:choice>
>            <xs:choice minOccurs="0">
>                 <xs:element ref="s1" maxOccurs="unbounded"/>
>                 <xs:element ref="s2" maxOccurs="unbounded"/>
>            </xs:choice>
>       </xs:choice>
>  </xs:complexType>
> 
>  <xs:complexType name="essaiRestrict">
>       <xs:complexContent>
>            <xs:restriction base="essai">
>                 <xs:choice>
>                      <xs:choice maxOccurs="unbounded">
>                           <xs:element ref="art1"/>
>                           <xs:element ref="art2"/>
>                  </xs:choice>
>                  <xs:choice>
>                           <xs:element ref="s1" maxOccurs="unbounded"/>
>                       <xs:element ref="s2" maxOccurs="unbounded"/>
>                  </xs:choice>
>              </xs:choice>
>         </xs:restriction>
>       </xs:complexContent>
>  </xs:complexType>
>  
> <xs:element name="art1"/>
>  <xs:element name="art2"/>
>  <xs:element name="s1"/>
>  <xs:element name="s2"/>
>  
> </xs:schema>
> 
> Can anybody explain the problem ?
> 
> Thanks in advance
> 
> --
> Bruno Chatel
> Tel : (+33) (0)4 96 11 14 57
> bcha@c...
> http://www.chadocs.com
> --------------------------------------
> 
> 



From bcha@c... Thu Jul 13 15:57:17 2006
Received: from lisa.w3.org ([128.30.52.41])
	by frink.w3.org with esmtp (Exim 4


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