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

Denis Zawada <[email protected]>
Newsgroups gmane.text.xml.schema.devel
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.