W3C home > Mailing lists > Public > xmlschema-dev@w3.org > March 2002

Elements in group optional and repeatable

From: Pete Johnston <p.johnston@ukoln.ac.uk>
Date: Mon, 4 Mar 2002 18:39:39 -0000
To: xmlschema-dev@w3.org
Message-ID: <000001c1c3ab$f437b500$2392268a@ukoln.ac.uk>
Hello all,

I'd like to set up a an xs:group which permits a set of elements to be
all optional and all repeatable. I've tried the following:

[assuming I have created a named complexType for "elementType"]

  <xs:element name="title" type="elementType"/>
  <xs:element name="creator" type="elementType"/>
  <xs:element name="subject" type="elementType"/>

  <xs:group name="elementsGroup">
    <xs:choice minOccurs="0" maxOccurs="unbounded">
      <xs:element ref="title" minOccurs="0" maxOccurs="unbounded"/>
      <xs:element ref="creator" minOccurs="0" maxOccurs="unbounded"/>
      <xs:element ref="subject" minOccurs="0" maxOccurs="unbounded"/>

XML Spy 4.3 seems to accept this (and give the desired behaviour on
validating instances against it), but both XSV (current online service)
and Xerces C++ 1.6.0 object to the use of minOccurs/maxOccurs on the
xs:choice element. 

The error message from XSV refers to "Invalid per cvc-complex-type.1.3"
but I'm struggling to see which rule at


this is breaking. 

Any thoughts appreciated.


Pete Johnston
Interoperability Research Officer
UKOLN, University of Bath, Bath BA2 7AY, UK
tel: +44 (0)1225 383619    fax: +44 (0)1225 386838
Received on Monday, 4 March 2002 13:38:34 UTC

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