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

Newbie question

From: Vineet Chaoji <chaoji@roguewave.com>
Date: Fri, 27 Dec 2002 13:49:15 -0800
Message-ID: <F888C30C3021D411B9DA00B0D0209BE804DBE48E@cvo-exchange.cvo.roguewave.com>
To: "'xmlschema-dev@w3.org'" <xmlschema-dev@w3.org>

Hi all,

I have a question regarding restriction in complexTypes.

Consider the following complexTypes

<xsd:complexType name="EntityT">
  <xsd:attribute name="entityTypeName" type="ent:EntityTypeNameT"
use="required"/>
</xsd:complexType>

<xsd:complexType name="ObsProjectEntityT">
  <xsd:complexContent>
      <xsd:restriction base="ent:EntityT">
         <xsd:attribute name="entityTypeName" type="ent:EntityTypeNameT"
fixed="ObsProject"/>
      </xsd:restriction>
  </xsd:complexContent>
</xsd:complexType>

ObsProjectEntityT restricts EntityT.
Now my question is whether it is necessary to have the use="required" in
ObsProjectEntityT when it puts constraints on the attribute entityTypeName.

Is it that attributes ('use' in this case) not defined in the restricting
complexType are assumed to be picked from the base complexType?

As per my understanding, the derived complexType should represent a subset
of the base complexType and the absence of use="required" (which implies
use="optional") in the derived complexType violates this rule.

Is my understanding correct? I would really appreciate if you have pointers
in the specs that clear this point.

Thanks,
Vineet
Received on Friday, 27 December 2002 16:51:09 GMT

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