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

> <?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]

Cheers,
/Eddie

[1] http://www.w3.org/TR/xmlschema-0/#OccurrenceConstraints
[2] http://www.w3.org/TR/xmlschema-1

Received on Sunday, 28 October 2001 21:38:18 UTC