restricting elements with anonymous types within named model groups

Hi,

Is this schema snippet valid?  Note that the element within the group
has an anonymous type.

<xs:complexType name="base">
  <xs:group ref="group1"/>
  <xs:attribute name="attr1"/>
</xs:complexType>

<xs:complexType name="derived">
  <xs:complexContent>
    <xs:restriction base="base">
      <xs:group ref="group1"/>
      <xs:attribute name="attr1" use="required"/>
    </xs:restriction>
  </xs:complexContent>
</xs:complexType>

<xs:group name="group1">
  <xs:sequence>
    <xs:element name="el1">
      <xs:simpleType>
        <xs:restriction base="xs:string"/>
      </xs:simpleType>
    </xs:element>
  </xs:sequence>
</xs:group>


If the sequence group were contained directly within the complex type,
it would not be valid since it is not possible to restrict an element
with an anonymous type.  Does the fact that it is in a named model group
affect this? I don't think it does - there are two separate particles
(the two group references), and one is not a valid restriction of the
other. 

I think the schema is invalid - but I just wanted to make sure.

Any thoughts?

Thanks,
Priscilla

-----------------------------------------------------
Priscilla Walmsley             priscilla@walmsley.com
Author, Definitive XML Schema     (Prentice Hall PTR)
----------------------------------------------------- 

Received on Saturday, 1 February 2003 11:46:12 UTC