Newbie question

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 UTC