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

If xsd:sequence has a minOccurs/maxOccurs, can child xsd:elements also have minOccurs/maxOccurs?

From: Doron Rosenberg <doronr@gmail.com>
Date: Mon, 29 Nov 2004 14:06:38 -0600
Message-ID: <6814aebd041129120651de6ad6@mail.gmail.com>
To: xmlschema-dev@w3.org
maxoccurs minoccurs xsd

>From the spec this seems valid, but I wanted to make sure as I am
working on a schema validator :)

<xsd:element name="balance">
  <xsd:complexType>
    <xsd:sequence minOccurs="0" maxOccurs="unbounded">
      <xsd:element name="transaction"/>
      <xsd:element name="person" type="xsd:string" maxOccurs="2"/>
    </xsd:sequence>
  </xsd:complexType>
</xsd:element>

Is this valid? And if it is, then the following xml would be valid right:
<balance>
  <transaction />
  <person>Foo 1</person>
  <transaction />
  <person>Foo 1</person>
  <person>Foo 2</person>
</balance>

Thanks!
Received on Monday, 29 November 2004 22:34:31 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.