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

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

From: Morris Matsa <mmatsa@us.ibm.com>
Date: Mon, 29 Nov 2004 17:57:57 -0500
To: Doron Rosenberg <doronr@gmail.com>
Cc: xmlschema-dev@w3.org
Message-ID: <OFEB5087D9.5097E1FB-ON85256F5B.007DE0B2-85256F5B.007E27C2@us.ibm.com>






This all looks ok.


Doron Rosenberg <doronr@gmail.com>@w3.org on 11/29/2004 03:06:38 PM

Please respond to Doron Rosenberg <doronr@gmail.com>

Sent by:    xmlschema-dev-request@w3.org


To:    xmlschema-dev@w3.org
cc:
Subject:    If xsd:sequence has a minOccurs/maxOccurs, can child
       xsd:elements also have minOccurs/maxOccurs?




>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:57:21 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 5 February 2014 23:40:23 UTC