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: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:37:19 GMT

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