W3C home > Mailing lists > Public > xmlschema-dev@w3.org > September 2000

Re: list attribute - type or itemType

From: Henry S. Thompson <ht@cogsci.ed.ac.uk>
Date: 23 Sep 2000 21:34:03 +0100
To: "Roger L. Costello" <costello@mitre.org>
Cc: xmlschema-dev@w3.org
Message-ID: <f5bg0mqx2ys.fsf@cogsci.ed.ac.uk>
"Roger L. Costello" <costello@mitre.org> writes:

> The XMLSchema.dtd says that the attribute of <list> is type.  The Primer
> shows it as itemType.  Running the following in xsv:
>     <simpleType name="NumbersList">
>         <list type="positiveInteger"/>
>     </simpleType>
> I get an error: list must have a type attribute.
> Which is it: type or itemType?


Where do you find a copy of the DTD with type?  Not at the namespace
URI (http://www.w3.org/2000/10/XMLSchema.dtd) -- I just checked.

> Another question while I am at it:  I wish to create a list of
> positiveInteger, where the list is restricted to six positiveInteger.  I
> could break it out into two separate simpleType definitions, as the
> Primer does.  However, I would like to do it all in one shot.  Here's my
> thinking:
>     <simpleType name="LotteryNumbers">
>         <list type="positiveInteger">
>             <restriction>
>                 <length value="6"/>
>             </restriction>
>         </list>
>     </simpleType>

> Is this correct?


> Note that <restriction> does not have a base attribute
> (the DTD says base is optional).  Since it does not have a base
> attribute does it "inherit" the list type (i.e., inherit the type of its
> context)?


The correct version is

     <simpleType name="LotteryNumbers">
         <list type="positiveInteger"/>
       <length value="6"/>

  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 Saturday, 23 September 2000 16:34:06 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:55:49 UTC