Re: Restriction of complex types by changing minOccurs

Hi Jenny. Thanks for pointing me to the appropriate part of
the spec.

Given your comment on the note, I proceeded to explicitly
define a base and derived type for Container and
used these in the corresponding Base and Restricted
type, but still get the same error.

The type of the Container element  in the derived type is now a
restriction of its equivalent  in the base type.

I suspect I still haven't quite understood. Specifically, I
didn't understand what Eric meant by

"This would limit the recursion to the top level of complex type
definitions, which seems reasonable..."

I would have thought that I could be an
arbitrary number of element definitions deep,
but provided the named type I use
is a valid restriction of the one used in the
base definition, I should be ok.

I've attached an update to my example.

Regards
Michael

(See attached file: example.xml)(See attached file: example.xsd)




                                                                                                                   
                    Jeni Tennison                                                                                  
                    <jeni@jeniten        To:     Mike_Leditschke@nemmco.com.au                                     
                    nison.com>           cc:     Eric van der Vlist <vdv@dyomedea.com>, xmlschema-dev@w3.org       
                                         Subject:     Re: Restriction of complex types by changing minOccurs       
                    13/11/2001                                                                                     
                    07:52 PM                                                                                       
                    Please                                                                                         
                    respond to                                                                                     
                    Jeni Tennison                                                                                  
                                                                                                                   
                                                                                                                   




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/




------------------------------------------
This e-mail is confidential.  If you are not the intended recipient, any use, disclosure or copying of this document is unauthorised and prohibited.  If you have received this document in error, please delete the email and notify me by return email or by phoning the NEMMCO Helpdesk on 1300 300 295.

Received on Tuesday, 13 November 2001 20:05:49 UTC