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

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