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