W3C home > Mailing lists > Public > xmlschema-dev@w3.org > August 2002

Re: Is this test case invalid (implicit derivation from ur-type / attribute wildcards)

From: Stefan Wachter <Stefan.Wachter@gmx.de>
Date: Thu, 15 Aug 2002 12:58:06 +0200 (MEST)
To: Jeni Tennison <jeni@jenitennison.com>; xmlschema-dev@w3.org
Message-ID: <15596.1029409086@www7.gmx.net>

Hi Jeni,

I agree, the elements really are of the ur-type. 

Yet the wildcard element and wildcard attributes of the ur-type have the
process content type "strict", i.e. there may appear only elements and
attributes inside that have a global declaration. This constraint is not satisfied in
the test case because the nested elements have local declaration and there
are no attribute declarations at all.

So the test case is incorrect. (But for another reason then originally
proposed).

--Stefan

> 
> Hi Stefan,
> 
> > in the Sun test suite there is a schema (xsd002.xsd) that derives types
> > implicitly from the ur-type:
> >
> >         <xsd:element name="root">
> >                 <xsd:complexType>
> >                         <xsd:choice maxOccurs="unbounded">
> >                                 <xsd:element name="foo" />
> >                                 <xsd:element name="bar" form="qualified"
> />
> >                                 <xsd:element name="zot"
> form="unqualified" />
> >                         </xsd:choice>
> >                 </xsd:complexType>
> >         </xsd:element>
> 
> OK, this is equivalent to:
> 
> <xsd:element name="root">
>   <xsd:complexType>
>     <xsd:choice maxOccurs="unbounded">
>       <xsd:element name="foo" type="xs:anyType" />
>       <xsd:element name="bar" form="qualified" type="xs:anyType" />
>       <xsd:element name="zot" form="unqualified" type="xs:anyType" />
>     </xsd:choice>
>   </xsd:complexType>
> </xsd:element>
> 
> If an element declaration doesn't have an explicit type attribute nor
> a nested anonymous complex type, then it is of the ur-type definition
> itself.
> 
> > In the instance document the element "zot" has attributes:
> >
> > <f:root xmlns:f="http://foo.com">
> >         <foo>
> >                 <this />
> >                 <contents />
> >                 should not be
> >                 validated
> >                 <because it="is ur-type" />
> >         </foo>
> >         <f:bar />
> >         <zot attributes="are" also="ignored">
> >                 when using <ur><type/></ur>
> >         </zot>
> > </f:root>
> >
> > I think that this test case is incorrect because an implicit
> > derivation is a short-hand for restricting the ur-type. Though the
> > ur-type has an attribute wildcard (namely <anyAttribute/>) this
> > wildcard is not inherited by complex type restrictions.
> 
> I think that you've misinterpreted what's going on here. The type of
> the element "zot" *is* the ur-type definition, not a restriction of
> the ur-type definition.
> 
> If you were talking about the f:root element, then you'd be right that
> if it had an attribute on it, it would be an error because the
> anyAttribute whildcard isn't inherited when you restrict a complex
> type.
> 
> Have I missed something?
> 
> Cheers,
> 
> Jeni
> 
> ---
> Jeni Tennison
> http://www.jenitennison.com/
> 
Received on Thursday, 15 August 2002 06:58:38 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:34 GMT