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

RE: Infinite recursion of complex types

From: Mukund Balasubramanian <mukund@cs.stanford.edu>
Date: Tue, 24 Apr 2001 12:00:48 -0700
To: "Ian Stokes-Rees" <ijs@decisionsoft.com>, <xmlschema-dev@w3.org>
Message-ID: <NKELLNPOKFOMLOJECCPJIEAHCFAA.mukund@cs.stanford.edu>
Yes, we came across the same problem too. Two ways of construing the

1)	The definition is legal and it is just that no instance document will be
2)	The definition itself is illegal.

We created a solution where we make the definition legal if maxOccurs > 1.
This gives an advantage over maxOccurs=1 when actually creating the
validation routines.

Hope this helps.


Mukund Balasubramanian

-----Original Message-----
From: xmlschema-dev-request@w3.org
[mailto:xmlschema-dev-request@w3.org]On Behalf Of Ian Stokes-Rees
Sent: Tuesday, April 24, 2001 3:44 AM
To: xmlschema-dev@w3.org
Subject: Infinite recursion of complex types

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"/>

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.

Ian Stokes-Rees                       DecisionSoft Ltd.
Telephone: +44-1865-203192            http://www.decisionsoft.com
Received on Tuesday, 24 April 2001 15:02:15 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:55:51 UTC