W3C home > Mailing lists > Public > xmlschema-dev@w3.org > May 2001

Re: Unanswered Questions - recursive declaration

From: Jeff Rafter <jeffrafter@definedweb.com>
Date: Fri, 11 May 2001 10:57:19 -0700
Message-ID: <015b01c0da43$d2c90fb0$f181fea9@lazarus>
To: "Ian Stokes-Rees" <ijs@decisionsoft.com>
Cc: <xmlschema-dev@w3.org>

> Is it legal XSDL to define an infinitely recursive structure?  For
> example (in XSDL shorthand):
> <element name="foo" type="bar" />
> <complexType name="bar">
>   <element name="foo" type="bar" minOccurs="1" maxOccurs="1"/>
> </complexType>

No it is not allowable [1] :

"Schema Component Constraint: Particle Emptiable

[Definition:]  For a particle to be emptiable one of the following must be
1 Its {min occurs} is 0.
2 Its {term} is a group and the minimum part of the effective total range of
that group, as defined by Effective Total Range (all and sequence) (3.8.6)
(if the group is all or sequence) or Effective Total Range (choice) (3.8.6)
(if it is choice), is 0. "

Essentially the effective total range is not 0.

> I can imagine this would be fine if minOccurs="0" because it could
> conceivably terminate, however with minOccurs="1" an instance document
> with a "foo" element in it would be infinite and impossible to
> generate.

Yes this would be allowable.

[1] http://www.w3.org/TR/xmlschema-1/#cos-group-emptiable

Jeff Rafter
Defined Systems
XML Development and Developer Web Hosting
Received on Friday, 11 May 2001 13:57:42 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:14:50 UTC