Re: list attribute - type or itemType

"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?

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?

No.

> 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)?

No.

The correct version is

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

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