W3C home > Mailing lists > Public > xmlschema-dev@w3.org > March 2007

RE: question about group circle definition

From: Michael Kay <mike@saxonica.com>
Date: Thu, 8 Mar 2007 10:00:16 -0000
To: "'Wang, Zhuo'" <zhuo.wang@intel.com>, <xmlschema-dev@w3.org>
Cc: "'Moog, Thomas H'" <thomas.h.moog@intel.com>
Message-ID: <008901c76168$92cc3ce0$6401a8c0@turtle>
The reason is that the group reference is not "within the model group at any depth", because it's in a different complexType:
 
    <xsd:group name="ul">
        <xsd:sequence>
            <xsd:element name="ul">
                <xsd:complexType>
                    <xsd:sequence>
                        <xsd:choice minOccurs="0" maxOccurs="unbounded">
                            <xsd:element name="li" /> 
                            <xsd:group ref="ul" minOccurs="0" maxOccurs="unbounded" /> 
                        </xsd:choice>
                    </xsd:sequence>
                </xsd:complexType>
            </xsd:element>
        </xsd:sequence>
    </xsd:group>
 
The constraint is on the schema component model, not the XML representation, and the schema component model is the same as if it had been written:
 
    <xsd:group name="ul">
        <xsd:sequence>
            <xsd:element name="ul" type="anonZZZ"/>
        </xsd:sequence>
    </xsd:group>
 
                <xsd:complexType name="anonZZZ">
                    <xsd:sequence>
                        <xsd:choice minOccurs="0" maxOccurs="unbounded">
                            <xsd:element name="li" /> 
                            <xsd:group ref="ul" minOccurs="0" maxOccurs="unbounded" /> 
                        </xsd:choice>
                    </xsd:sequence>
                </xsd:complexType>

which makes it clear that the group does not actually contain a reference to itself.
 
Michael Kay
http://www.saxonica.com/


  _____  

From: xmlschema-dev-request@w3.org [mailto:xmlschema-dev-request@w3.org] On Behalf Of Wang, Zhuo
Sent: 08 March 2007 08:39
To: Michael Kay; xmlschema-dev@w3.org
Cc: Moog, Thomas H
Subject: RE: question about group circle definition 



The case is: 

/xmlschema2006-11-06/msData/particles/particlesZ010.xsd

 

Thanks, 

-Wang Zhuo 


  _____  


From: Michael Kay [mailto:mike@saxonica.com] 
Sent: 2007年3月8日 16:38
To: Wang, Zhuo; xmlschema-dev@w3.org
Cc: Moog, Thomas H
Subject: RE: question about group circle definition 

 

Could you give the name of the test case please?

 

Michael Kay

http://www.saxonica.com/

 


  _____  


From: xmlschema-dev-request@w3.org [mailto:xmlschema-dev-request@w3.org] On Behalf Of Wang, Zhuo
Sent: 08 March 2007 01:31
To: xmlschema-dev@w3.org
Cc: Moog, Thomas H
Subject: question about group circle definition 

Hi All, 

 

I meet a case in w3c test suite: 

 

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">

 

    <xsd:complexType name="a">

        <xsd:sequence>

            <xsd:group ref="ul" minOccurs="0" maxOccurs="unbounded"/> 

        </xsd:sequence>

    </xsd:complexType> 

 

    <xsd:group name="ul">

        <xsd:sequence>

            <xsd:element name="ul">

                <xsd:complexType>

                    <xsd:sequence>

                        <xsd:choice minOccurs="0" maxOccurs="unbounded">

                            <xsd:element name="li" /> 

                            <xsd:group ref="ul" minOccurs="0" maxOccurs="unbounded" /> 

                        </xsd:choice>

                    </xsd:sequence>

                </xsd:complexType>

            </xsd:element>

        </xsd:sequence>

    </xsd:group>

 

</xsd:schema>

 

I think this case voilate:

3.8.6 Constraints on Model Group Schema Components

All model groups (see Model Groups (¡ì3.8)) must satisfy the following

constraints.

 

Schema Component Constraint: Model Group Correct

All of the following must be true:

2 Circular groups are disallowed. That is, within the {particles} of a group

there must not be at any depth a particle whose {term} is the group itself.

 

However, many schema validators say it is a valid case. 

Somebody knows the reason? 

 

Thanks, 

- Wang Zhuo    

~~~~~~~~~~~~~~~~~~~~~~~~

Intel Asia-Pacific R&D Ltd.

No. 880 ZiXing Road, ZiZhu Science Park,

Shanghai, PRC, 200241

~~~~~~~~~~~~~~~~~~~~~~~~

 
Received on Thursday, 8 March 2007 10:00:41 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:15:41 UTC