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

Re: Recursive element definition

From: <Mike_Leditschke@nemmco.com.au>
Date: Tue, 12 Jun 2001 10:51:28 +1000
To: "Jeff Rafter" <jeffrafter@definedweb.com>
Cc: xmlschema-dev@w3.org
Message-ID: <OFF21120DA.DFFFB1DA-ON4A256A69.00042C4A@nemmco.com.au>

Jeff, given that the schema shown does not provide minOccurs/maxOccurs
attributes, the defaults
for theses are 1 and 1. So because of the defaults, the minOccurs for
CATEGORY is 1. Hence,
by your logic, isn't the schema infinitely recursive?

I think the element referring to CATEGORY needs a minOccurs attribute?


                    "Jeff Rafter"                                                                                                            
                    <jeffrafter@define        To:     <xmlschema-dev@w3.org>                                                                 
                    dweb.com>                 cc:                                                                                            
                    Sent by:                  Subject:     Re: Recursive element definition                                                  
                    12/06/2001 02:25                                                                                                         


This is okay and happens quite often.  The thing you want to make sure of
that the particle is emptiable-- meaning you don't want to force the
definition to be infinite (which you haven't done).  For example if you set
the minOccurs of CATEGORY to 1 this structure would go on recursively


Good luck,
Jeff Rafter
Defined Systems
XML Development and Developer Web Hosting

----- Original Message -----
From: "Stefan Panek" <spanek@siebel.com>
To: <xmlschema-dev@w3.org>
Sent: Monday, May 28, 2001 1:41 AM
Subject: Recursive element definition

> Hi there,
> I trying to solve the following problem:
> I want define a elemet CATEGORY.
> As a category can contain sub-categories the element itself is used again
> "child"-element in the "parent"-element.
> I tried the following Schema-definition. But is looks somehow strange to
> <xsd:element name="CATEGORY">
> <xsd:complexType>
> <xsd:sequence>
> <xsd:element ref="CATEGORY">
> <xsd:element ref="PART"/>
> </xsd:sequence>
> <xsd:attribute name="NAME" type="xsd:string" use="required"/>
> <xsd:attribute name="SEQ" type="xsd:integer" use="required"/>
> </xsd:complexType>
> </xsd:element>
> Can anyone verify that or has a tip for me ?
> Thx.
> Stefan
Received on Monday, 11 June 2001 20:53:22 UTC

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