W3C home > Mailing lists > Public > xmlschema-dev@w3.org > June 2011

Re: What is this simpleType's "base" type?

From: Denis Zawada <deno@deno.pl>
Date: Sat, 18 Jun 2011 14:50:00 +0200
To: xmlschema-dev@w3.org
Message-Id: <201106181450.00970.deno@deno.pl>
On Saturday 18 of June 2011 13:35:59 Costello, Roger L. wrote:
> Hi Folks,
> 
> Perhaps "parent" simpleType is the appropriate term?
> 
> In my LotteryNumbers example, would it be appropriate to say that the
> OneToNintyNine simpleType is the "parent" simpleType of LotteryNumbers?
> 
> /Roger

OneToNinetyNine restricts http://www.w3.org/2001/XMLSchema#positiveInteger

LotteryNumbers = List<OneToNinetyNine>


http://www.w3.org/2001/XMLSchema#double
  http://www.w3.org/2001/XMLSchema#integer
    http://www.w3.org/2001/XMLSchema#positiveInteger
      {mylottery}OneToNinetyNine

List<?>
  LotteryNumbers = List<OneToNinetyNine>
    LotteryNumbers (anonymous restriction)

LotteryNumbers is a restriction for a container, but the container itself does 
not subclass its items.

To illustrate, lets define each step explicitly:

<xs:simpleType name="LotteryNumbers">
    <xs:list itemType="OneToNinetyNine"/>
</xs:simpleType>

<xs:simpleType name="LuckyLotteryNumbers">
  <xs:restriction base="LotteryNumbers">
    <xs:length value="6" />
  </xs:restriction>
</xs:simpleType>


Then you can clearly see that the inheritance chain is as follows:

List<?>
  LotteryNumbers = List<OneToNinetyNine>
    LuckyLotteryNumbers

This has also practical implications. For example in LuckyLotteryNumbers 
restriction you only can restrict properties that you inherit from a ‘list’, 
however you can't redefine any properties that are inherent to 
OneToNinetyNine.

Hope this helps,
Denis Zawada
Received on Sunday, 19 June 2011 00:11:21 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Sunday, 19 June 2011 00:11:24 GMT