Re: Adding attributes to lists

Jane Hunter <jane@dstc.edu.au> writes:

> We're already using appinfo to define the dimensions of fixed-sized arrays. See 
> below:
> 
> <simpleType name="matrix2x2OfInteger">
>      <list itemType="integer">
>         <annotation><appinfo>
>                 <mpeg7:dimension value="2 2"/>
>          </appinfo></annotation>
>      </list>
> </simpleType>
> 
> But we also need a mechanism for defining the dimensions of variable-sized 
> arrays at run-time. An attribute value is the only way that we can do this.
> 
> We don't expect an XML Schema processor to validate the size of the
> list against the mpeg7:dim value - this will only be performed by
> MPEG-7 processors.  But we would like XML Schema processors not to
> generate an error when an attribute is associated with a list.

Ah right, I misunderstood your original question.  That prohibition
applies to a new _simple_ type, you can certainly derive a complex
type from your own list type, as below -- no problem.

> <simpleType name="listofInteger">
>    <list itemType="integer"/>
> </simpleType>

> <complexType name="nDimIntegerArray">
>   <simpleContent>
>     <extension base="listOfInteger">
>         <attribute ref="mpeg7:dim"/>
>     </extension>
>   </simpleContent>
> </complexType>

> <element name="integerMatrix" type="nDimIntegerArray"/>

> <integerMatrix mpeg7:dim="2 4">1 2 3 4 5 6 7 8</integerMatrix>

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 Monday, 23 October 2000 09:33:24 UTC