anonymous types and extensions

The examples I have seen using the derivation by extension
mechanism have all used an existing type as the base. Is it
possible to use an anonymous type in this situation?

For example, if I wish to have an element with simple content
consisting of a 10 character string and having a single checksum
attribute taking a value between 0 and 9, is the following legal?
(XMLSpy doesn't think so).

Schema

  <element name="Simple">
    <complexType>
      <simpleContent>
        <extension>
           <simpleType>
             <restriction base="string">
               <length value="10"/>
             </restriction>
           </simpleType>
           <attribute name="checksum" use="required">
             <simpleType>
               <restriction base="integer">
                 <minInclusive value="0"/>
                 <maxInclusive value="9"/>
               </restriction>
             </simpleType>
           </attribute>
        </extension>
      </simpleContent>
    </complexType>
  </element>


Example

<Simple checksum="5">abcdefghij</Simple>


I'm basically trying to avoid having to define a type for the simple
content of the element.

Thanks
Michael

Received on Wednesday, 20 December 2000 20:31:48 UTC