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

Re: Recursive element definition

From: Jeff Rafter <jeffrafter@definedweb.com>
Date: Mon, 11 Jun 2001 09:25:21 -0700
Message-ID: <005801c0f293$1c90a650$f181fea9@lazarus>
To: <xmlschema-dev@w3.org>

This is okay and happens quite often.  The thing you want to make sure of is
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 12:25:44 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:55:52 UTC