Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: E rcase-RecurseLax.1: Group's occurrence range, (1,unbounded), is not a valid restriction of base group's occurrence range, (1,1).

From: George Cristian Bina <george@---------.--->
To: richard.liu@---.---
Date: 2/13/2006 1:34:00 PM
Hello Richard,

Xerces is right to report that error as I read the spec. To have this 
correct you need to add an empty sequence as below:
<xs:choice>
   <xs:group ref="a-Group" maxOccurs="unbounded"/>
   <xs:sequence/>
</xs:choice>
Otherwise the main choice particle is ignored according to
http://www.w3.org/TR/xmlschema-1/#cos-particle-restrict
See 2, 2.2, 2.2.2, 2.2.2.2.1.
***
2.2 Any pointless occurrences of <sequence>, <choice> or <all> are 
ignored, where pointlessness is understood as follows:
<choice>
One of the following must be true:
2.2.2 All of the following must be true:
2.2.2.1 The particle within which this <choice> appears has {max occurs} 
and {min occurs} of 1.
2.2.2.2 One of the following must be true:
2.2.2.2.1 The <choice>'s {particles} has only one member.
***

and the restricted type is equivalent with only
<xs:group ref="a-Group" maxOccurs="unbounded"/>

that is equivalent with

<xs:choice maxOccurs="unbounded">
   <xs:element ref="a1"/>
   <xs:element ref="a2"/>
   <xs:element ref="a3"/>
</xs:choice>

and this cannot restrict

<xs:choice>
   <xs:group ref="a-Group" maxOccurs="unbounded"/>
   <xs:element ref="b"/>
</xs:choice>

as the choice here has minOccurs and maxOccurs equal with 1.

Best Regards,
George
---------------------------------------------------------------------
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
www.---.com


richard.liu@u... wrote:
> I have the following W3C XML schema:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"  
> elementFormDefault="qualified" targetNamespace="http://www.ubs.com/
> namespace/wbml-render" xmlns="http://www.ubs.com/namespace/wbml-
> render" xmlns:wbr="http://www.ubs.com/namespace/wbml-render">
>      <xs:element name="a" type="xs:string"/>
>      <xs:element name="a1" type="xs:string"/>
>      <xs:element name="a2" type="xs:string"/>
>      <xs:element name="a3" type="xs:string"/>
>      <xs:element name="b" type="xs:integer"/>
>      <xs:group name="a-Group">
>          <xs:choice>
>              <xs:element ref="a1"/>
>              <xs:element ref="a2"/>
>              <xs:element ref="a3"/>
>          </xs:choice>
>      </xs:group>
>      <xs:complexType name="groupBaseType">
>          <xs:choice>
>              <xs:group ref="a-Group" maxOccurs="unbounded"/>
>              <xs:element ref="b"/>
>          </xs:choice>
>      </xs:complexType>
>      <xs:complexType name="groupRestrictedType">
>          <xs:complexContent>
>              <xs:restriction base="groupBaseType">
>                  <xs:choice>
>                      <xs:group ref="a-Group" maxOccurs="unbounded"/=
>
>                  </xs:choice>
>              </xs:restriction>
>          </xs:complexContent>
>      </xs:complexType>
>      <xs:complexType name="baseType">
>          <xs:choice>
>              <xs:element ref="a" maxOccurs="unbounded"/>
>              <xs:element ref="b"/>
>          </xs:choice>
>      </xs:complexType>
>      <xs:complexType name="restrictedType">
>          <xs:complexContent>
>              <xs:restriction base="baseType">
>                  <xs:choice>
>                      <xs:element ref="a" maxOccurs="unbounded"/>
>                  </xs:choice>
>              </xs:restriction>
>          </xs:complexContent>
>      </xs:complexType>
> </xs:schema>
> 
> The a-Group is a choice of three elements.  The groupBaseType is a choi=
ce of either one to unbounded many instances of a-Group, or of the elemen=
t b.  I want to define another complex type as a restriction of the group=
BaseType.  It should not allow b.
> 
> In Oxygen 7 I receive the following two error messages.
> 
> SystemID: /Applications/oxygen/Untitled1.xsd
> Location: 21:48
> Description: E rcase-RecurseLax.1: Group's occurrence range, (1,unbound=
ed), is not a valid restriction of base group's occurrence range, (1,1).
> URL: http://www.w3.org/TR/xmlschema-1/#rcase-RecurseLax
> 
> SystemID: /Applications/oxygen/Untitled1.xsd
> Location: 21:48
> Description: E derivation-ok-restriction.5.4.2: Error for type 'groupRe=
strictedType'.  The particle of the type is not a valid restriction of th=
e particle of the base.
> URL: http://www.w3.org/TR/xmlschema-1/#derivation-ok-restriction
> 
> Evidently, based on the second example using baseType and restrictedTyp=
e, the error messages pertain to the fact that I am using a group, but I =
don't understand what is wrong.  Can anybody shed light on the error?
> 
> Regards,
> Richard
> 
> Richard R. Liu
> Gundeldingerstr. 171
> CH-4053 Basel
> Switzerland
> 
> Tel. +41 (61) 361 3275
> Email richard.liu@m...
> 
> 
> 
> Richard R. Liu
> UBS AG
> VZA2 - 4.140 IVHS-L2V
> Postfach
> CH-8098 Z=FCrich
> Switzerland
> 
> Tel.  +41-44-238 48 82
> Email richard.liu@u...
> 

From mike@s... Mon Feb 13 11:33:36 2006
Received: from maggie.w3.org ([193.51.208.68])
	by frink.w3.org with esmtp (Exim 4.50)
	id 1F8bxX-00052Q-UG
	for xmlschema-dev@listhub


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