Re: Restriction of complex types by changing minOccurs

Eric wrote:
> Mike_Leditschke@nemmco.com.au wrote:
>> Hi. I am getting an error generated by Xerces-J for a schema that
>> validates ok for XSV (1.4) and XMLSpy (4.1). I would appreciate an
>> expert eye looking over it before I chase it on xerces-j-user.
>> Schema and example below.
>
> Your schema seems perfectly valid.

I disagree. For RestrictedType to be a valid restriction of BaseType,
the particle for the Container element in RestrictedType must fulfil
'Schema Component Constraint: Particle Restriction OK (Elt:Elt --
NameAndTypeOK)'
(http://www.w3.org/TR/xmlschema-1/#rcase-NameAndTypeOK).

I think it's all OK until we get to point 7 in that list:

  7 R's {type definition} is validly derived given {extension, list,
    union} from B's {type definition} as defined by Type Derivation OK
    (Complex) (§3.4.6) or Type Derivation OK (Simple) (§3.14.6), as
    appropriate.

    NOTE: The above constraint on {type definition} means that in
    deriving a type by restriction, any contained type definitions
    must themselves be explicitly derived by restriction from the
    corresponding type definitions in the base definition.

The note clarifies the matter - the Container element's type
definition in RestrictedType must be an explicit restriction of its
type in BaseType. They're anonymous types, so there's no explicit
restriction, so the schema component constraint isn't satisfied, so
the schema isn't valid.

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/

Received on Tuesday, 13 November 2001 09:33:48 UTC