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

Re: Recursion in XML Schema

From: Eric van der Vlist <vdv@dyomedea.com>
Date: Thu, 25 Oct 2001 18:00:16 +0200
Message-ID: <3BD83710.5030706@dyomedea.com>
To: Karuna A <a_karuna@hotmail.com>, xmlschema-dev@w3.org

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 11:59:50 UTC

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