RE: Circular types in XML Schemas

It seems this is allowed as a legal schema, but clearly this type will
never end up in a PSVI as the type of some XML, because it could never
validate any actual document.  Schema authors should probably avoid such
definitions.


Yuri de Wit <yuri.dewit@metaserver.com>@w3.org on 05/01/2002 11:32:59 AM

Sent by:    xmlschema-dev-request@w3.org


To:    "'Jeni Tennison'" <jeni@jenitennison.com>
cc:    "'xmlschema-dev@w3.org'" <xmlschema-dev@w3.org>
Subject:    RE: Circular types in XML Schemas



Jeni,

What does the XML Schema specification says about infinite recursive types,
i.e. the ones that do not have a minOccurs="0" as a loophole?

Like the following error schema:
 <complexType name="error">
        <sequence>
            <element name="name" type="xsd:string"/>
            <element name="code" type="xsd:string" />
            <element name="message" type="xsd:string" />
            <element name="description" type="xsd:string" minOccurs="0"/>
            <element name="source" type="xsd:string" minOccurs="0"/>
            <element name="content" type="xsd:base64Binary" minOccurs="0"/>
            <element name="error" type="ms:error"/>
        </sequence>
 </complexType>

Thanks,

Yuri

Received on Friday, 3 May 2002 12:26:24 UTC