W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > January to March 2000

Re: Parametric minOccurs, maxOccurs?

From: Henry S. Thompson <ht@cogsci.ed.ac.uk>
Date: 15 Mar 2000 09:55:03 +0000
To: "Eric Rehm" <rehm@singingfish.com>
Cc: <www-xml-schema-comments@w3c.org>
Message-ID: <f5b66uo4ky0.fsf@cogsci.ed.ac.uk>
"Eric Rehm" <rehm@singingfish.com> writes:

> I'd like to restrict the number of elements in a <sequence> by an attribute,
> e.g.,
> <!-- desired, but not currently valid, XML Schema -->
> <complexType name="VectorI">
>     <attribute name="Size" type="integer"/>
>     <sequence minOccurs="Size" maxOccurs="Size"> 
>         <element name="ValueVectorI" type="integer"/>
>     </sequence>
>  </complexType>
> This seems like it would be a pretty common schema feature.  Is
> there a way to do this?

Two classes of co-constraints were considered by the WG for XML Schema
but postponed for a later version:

  co-occurrence constraints among the attributes and children of an
  element, e.g. "this attribute XOR that attribute";

  instance-parameterised constraints (you need one such to provide a
  strict schema for an XSLT stylesheet).

Your requirement falls in to the latter category.  We hope to provide
for it, but not in v.1.

  Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
          W3C Fellow 1999--2001, part-time member of W3C Team
     2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
	    Fax: (44) 131 650-4587, e-mail: ht@cogsci.ed.ac.uk
		     URL: http://www.ltg.ed.ac.uk/~ht/
Received on Wednesday, 15 March 2000 04:55:06 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:08:46 UTC