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

Re:: Recursion in an XML Schema

From: Jose Maria Sanchez Saez <jmss@gssi.es>
Date: Thu, 1 Nov 2001 15:07:24 +0100
To: xmlschema-dev@w3.org
Message-Id: <01110115072401.09750@jmss.gssi.es>
Hi Matthew and Jeni.

I have been looking at your emails, and I have seen something that looks 
strange for me.

I think that in your schemas the structure would be infinitely anitate. Isn't 
it?

> <schema>
>    <complexType name="SectionType">
>        <sequence>
>            <element name="section" type="SectionType">
>            <annotation>
>                <documentation>Recursive</documentation>
>            </annotation>
>        </element>
>    </sequence>
>    </complexType>
>    <element name="section" type="SectionType"/>
></schema>


When you declare the element "section", you would have to make it optional. 
Perhaps at this way
<element name="section" type="SectionType" minoccurs="0"/>
or 
<element ref="section" minoccurs="0"/>

Am I right?

Thanks and excuse my english.
Received on Thursday, 1 November 2001 08:09:15 GMT

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