[XMLSCHEMA-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Defining recursive elements?

From: Andrew Welch <andrew.j.welch@gmail.com>
Date: Thu, 17 May 2007 15:08:32 +0100
Message-ID: <74a894af0705170708i193a955fs3c8426b78a4282bf@mail.gmail.com>
To: "Todd Moon" <tmrfcm@gmail.com>
Cc: xmlschema-dev@w3.org
Re: Defining recursive elements?

On 5/17/07, Todd Moon <tmrfcm@gmail.com> wrote:
>
> Thank you Michael and Shlomo. I didn't know about the ref attribute.
> You saved me a lot of time reading documentation. :)

Well it's a matter of taste, but if you use the venetian blind style
of schema then you wouldn't use element ref="" much, but @type
instead, eg:

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

  <xs:element name="part" type="part"/>
	
  <xs:complexType name="part">
    <xs:sequence>
      <xs:element name="part" type="part" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="serial" type="xs:string"/>
  </xs:complexType>

</xs:schema>

cheers
andrew
Received on Thursday, 17 May 2007 14:08:37 GMT

Subscribe to the Stylus Scoop newsletter for helpful XML tips and tutorials.
Email
First Name
Last Name
Company

Download Stylus Studio 6 XML Enterprise Edition

Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.