Re: Recursion in XML Schema

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].

Morris

[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
cc:
Subject:  Re: Recursion in XML Schema



Hi,


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
has
 > <property> as it's possible child. Is this valid?!? Will instance
documents
 > 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:

http://lists.w3.org/Archives/Public/xmlschema-dev/2001Oct/thread.html#138

Hope this helps.

Eric

 > Please help. Thanks
 > --Karuna


--
Rendez-vous à Paris pour le Forum XML.
                     http://www.technoforum.fr/Pages/forumXML01/index.html
------------------------------------------------------------------------
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