Re: anonymous types and extensions

Mike_Leditschke@nemmco.com.au writes:

> 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.

Sorry, that's a gap in the paradigm at the moment.  Send a comment to
the comments list [1] if you want to formally register a "I need this
to do my work" observation.

ht
-- 
  Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
          W3C Fellow 1999--2001, part-time member of W3C Team
     2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
	    Fax: (44) 131 650-4587, e-mail: ht@cogsci.ed.ac.uk
		     URL: http://www.ltg.ed.ac.uk/~ht/

Received on Thursday, 21 December 2000 11:17:36 UTC