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
problem:

1)	The definition is legal and it is just that no instance document will be
valid
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.

ThanX,

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

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.
--
Ian Stokes-Rees                       DecisionSoft Ltd.
Telephone: +44-1865-203192            http://www.decisionsoft.com
Received on Tuesday, 24 April 2001 15:02:15 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:20 GMT