Re: Can a Global Element have a minOccurs and maxOccurs?

Eddie Robertsson <eddie@allette.com.au> writes:

> > <?xml version="1.0" encoding="UTF-8"?>
> > <schema xmlns="http://www.w3.org/2001/XMLSchema"
> > xmlns:test="http://test.com/test"
> > targetNamespace="http://test.com/test" >
> >
> >   <element name="test" type="string" minOccurs="2"
> > maxOccurs="4"/>
> >
> > </schema
> >
> > Some people tell me yes and others say no.  I tested
> > it against IBM's XML Schema validator and it says yes.
> 
> The people saying no would be correct.
> The Primer says (at the end of the table) [1]:
> 
> "Note that neither minOccurs, maxOccurs, nor use may appear in the
> declarations of global elements and attributes."
> 
> I'm not sure where this is stated in [2]

It's not in the prose of [2], probably should be -- it's in the schema 
for schemas, which forbids min/maxOccurs on top-level <element>.

ht

> [1] http://www.w3.org/TR/xmlschema-0/#OccurrenceConstraints
> [2] http://www.w3.org/TR/xmlschema-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 Monday, 29 October 2001 03:21:26 UTC