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

Newbie question regarding restriction

From: Vineet Chaoji <chaoji@roguewave.com>
Date: Mon, 4 Nov 2002 10:31:58 -0800
Message-ID: <F888C30C3021D411B9DA00B0D0209BE803EB4591@cvo-exchange.cvo.roguewave.com>
To: "'xmlschema-dev@w3.org'" <xmlschema-dev@w3.org>

Hi,

I have the following schema:

<xs:complexType name="ImageDict">
  <xs:sequence>
    <xs:element name="ColorSpace">
      <xs:complexType>
        <xs:complexContent>
          <xs:restriction base="Object_t">
            <xs:choice>
              <xs:element name="Name" type="Name_t" />
              <xs:element name="Array" type="Array_t" />
            </xs:choice>
          </xs:restriction>
        </xs:complexContent>
      </xs:complexType>
    </xs:element>
        .......
       ........
  </xs:sequence>
</xs:complexType>
 
<xs:complexType name="Object_t">
  <xs:annotation>
    <xs:documentation></xs:documentation>
  </xs:annotation>
  <xs:attribute name="ID" type="xs:ID" use="optional" />
  <xs:attribute name="IDREF" type="xs:IDREF" use="optional" />
</xs:complexType>

The ColorSpace element inside the ImageDict complexType restricts Object_t.
But the Name and Array elements (inside the choice) that it is trying to 
restrict are not present in the base complexType.
As per my understanding, for restriction the particle that is being
restricted 
has to be present in the complexType that is being restricted.

Am I correct (and that means that the schema is incorrect)?
I tried looking at the spec but couldnt find anything concrete that ratifies
my understanding.
Could you point out the section in the spec that confirms/negates my
understanding?

Is there a simplified/annotated version of the schema spec? To understand
anything in 
the current spec I have to read it atleast 2-3 times.

Thanks in anticipation,
Vineet
Received on Monday, 4 November 2002 13:36:47 GMT

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