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

Re: Recursion in XML Schema

From: Morris Matsa <mmatsa@us.ibm.com>
Date: Thu, 25 Oct 2001 14:33:03 -0400
To: Eric van der Vlist <vdv@dyomedea.com>
Cc: Karuna A <a_karuna@hotmail.com>, xmlschema-dev@w3.org
Message-ID: <OF74134F48.C559A06E-ON85256AF0.00663239@pok.ibm.com>

The one caveat is that the recursive structure must be satisfiable by a
finite instance, e.g. type foo can not require a sub-tag of type foo.
This was explained in [1].


[1] http://lists.w3.org/Archives/Public/xmlschema-dev/2001May/0053.html

Eric van der Vlist <vdv@dyomedea.com>@w3.org on 10/25/2001 12:00:16 PM

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

To:   Karuna A <a_karuna@hotmail.com>, xmlschema-dev@w3.org
Subject:  Re: Recursion in XML Schema


Karuna A wrote:

 > Hi:I am defining an XML schema for predicate properties. In the
process, I
 > have defined a global element and a global complex type associated
with it.
 > Now, can this complex type be referenced inside another element which
is of
 > this complex type itself? Here is an example:
 > <property> := <invariant>|<next>|<stable>
 > <invariant> := <predicate>|<quantification>|<property>
 > See how <property> has <invariant> as a child and <invariant> in turn
 > <property> as it's possible child. Is this valid?!? Will instance
 > be valid if such recusrsion of elements occurs?

Sure, the XML Schema vocabulary itself gives us a bunch of such
recursions! (xs:elements , xs:complexType, xs:sequence to name few can
all be nested).

To do so, the simplest way is to define your elements as global and
reference them.

This has recently been discussed in this thread:


Hope this helps.


 > Please help. Thanks
 > --Karuna

Rendez-vous  Paris pour le Forum XML.
Eric van der Vlist       http://xmlfr.org            http://dyomedea.com
http://xsltunit.org      http://4xt.org           http://examplotron.org
Received on Thursday, 25 October 2001 14:38:28 UTC

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