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: Jeni Tennison <jeni@jenitennison.com>
Date: Thu, 15 Aug 2002 11:37:17 +0100
Message-ID: <61248871648.20020815113717@jenitennison.com>
To: xmlschema-dev@w3.org, Stefan Wachter <Stefan.Wachter@gmx.de>

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: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" />

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

> 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

Have I missed something?



Jeni Tennison
Received on Thursday, 15 August 2002 06:37:19 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:55:58 UTC