Page 1 of 1

E rcase-RecurseLax.1 Group's range, (1,unbounded), ...

Posted: Sun Feb 12, 2006 10:45 pm
by rrliu
This is my 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>

For the complex type groupRestrictedType I receive these two error messages in Oxygen 7:

E rcase-RecurseLax.1: Group's occurrence range, (1,unbounded), is not a valid restriction of base group's occurrence range, (1,1).
E derivation-ok-restriction.5.4.2: Error for type 'groupRestrictedType'. The particle of the type is not a valid restriction of the particle of the base.

Compare the "invalid" type with the valid restrictedType!

What am I missing here?

Thanks,
Richard

Posted: Mon Feb 13, 2006 12:29 pm
by george
Hello Richard,

I replied to your question on the xml schema dev list:
http://lists.w3.org/Archives/Public/xml ... /0012.html
In summary, Xerces is right as the main choice from the derived type is ignored as pointless occurence according to
http://www.w3.org/TR/xmlschema-1/#cos-particle-restrict

Best Regards,
George