W3C home > Mailing lists > Public > xmlschema-dev@w3.org > February 2003

restricting elements with anonymous types within named model groups

From: Priscilla Walmsley <priscilla@walmsley.com>
Date: Sat, 1 Feb 2003 11:45:57 -0500
To: <xmlschema-dev@w3.org>
Message-ID: <004f01c2ca11$65ace680$ca3bfea9@WALMSLEYPH>


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 name="derived">
    <xs:restriction base="base">
      <xs:group ref="group1"/>
      <xs:attribute name="attr1" use="required"/>

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

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

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

Any thoughts?


Priscilla Walmsley             priscilla@walmsley.com
Author, Definitive XML Schema     (Prentice Hall PTR)
Received on Saturday, 1 February 2003 11:46:12 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:15:09 UTC