W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > January to March 2001

RE: SimpleContent question

From: Jeff Lowery <jlowery@scenicsoft.com>
Date: Thu, 1 Mar 2001 12:59:09 -0800
Message-ID: <3549BAFD79A7D411A1CF00508B62B5BC766A38@exchange-us.scenicsoft.com>
To: "'ht@cogsci.ed.ac.uk'" <ht@cogsci.ed.ac.uk>, Jeff Lowery <jlowery@scenicsoft.com>
Cc: "'www-xml-schema-comments@w3.org'" <www-xml-schema-comments@w3.org>
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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Sunday, 6 December 2009 18:12:49 GMT