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"/>
    </xs:choice>
  </xs:group>

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

http://www.w3.org/TR/xmlschema-1/#cvc-complex-type

this is breaking. 

Any thoughts appreciated.

Thanks

Pete
-------
Pete Johnston
Interoperability Research Officer
UKOLN, University of Bath, Bath BA2 7AY, UK
tel: +44 (0)1225 383619    fax: +44 (0)1225 386838
mailto:p.johnston@ukoln.ac.uk
http://www.ukoln.ac.uk/ukoln/staff/p.johnston/
  
Received on Monday, 4 March 2002 13:38:34 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:29 GMT