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

This should cover W3C XML Schema, Relax NG and DTD related problems.
rrliu
Posts: 37
Joined: Sun Feb 12, 2006 10:34 pm

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

Post by rrliu » Sun Feb 12, 2006 10:45 pm

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

george
Site Admin
Posts: 2101
Joined: Thu Jan 09, 2003 2:58 pm

Post by george » Mon Feb 13, 2006 12:29 pm

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

Post Reply