RE: SimpleContent question

Yes, thanks. I can see now that I misread one of the productions in section
"4.3.3", and that the rules for using a restriction off of a complexType
base in the SimpleContent case are spelled out quite clearly further on. 

> -----Original Message-----
> From: ht@cogsci.ed.ac.uk [mailto:ht@cogsci.ed.ac.uk]
> Sent: Thursday, March 01, 2001 11:40 AM
> To: Jeff Lowery
> Cc: 'www-xml-schema-comments@w3.org'
> Subject: Re: SimpleContent question
> 
> 
> Jeff Lowery <jlowery@scenicsoft.com> writes:
> 
> > The spec states that simpleContent can restrict an existing 
> simple type, but
> > within the context of defining a complex type I can't see 
> how it would be
> > used. Since a simple type can't have an attribute, and a 
> complex type with
> > simple content would be expected to have at least one, how 
> can restricting a
> > simple type be of any use in that case? One would just use 
> an anonymous
> > simple type and restrict that.
> 
> <xs:complexType name="length">
>  <xs:simpleContent>
>   <xs:extension base="xs:integer">
>    <xs:attribute name="units"/>
>   </xs:extension>
>  </xs:simpleContent>
> </xs:complexType>
> 
> <xs:complexType name="posLength">
>  <xs:simpleContent>
>   <xs:restriction base="length">
>    <xs:minExclusive value="0"/>
>   </xs:restriction>
>  </xs:simpleContent>
> </xs:complexType>
> 
> Does this help?  Both posLength and length allow a 'units' attribute,
> but where length allows an integer as content, posLength requires a
> positive one.
> 
> 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, 1 March 2001 16:00:24 UTC