W3C home > Mailing lists > Public > xmlschema-dev@w3.org > September 2003

Re: Inheritance

From: Jeni Tennison <jeni@jenitennison.com>
Date: Tue, 23 Sep 2003 10:06:01 +0100
Message-ID: <121309704551.20030923100601@jenitennison.com>
To: -saNetta- <san_netta@yahoo.com>
Cc: xmlschema-dev@w3.org

Hi San,

> <xsd:attribute name="number" type="NumberType" use="required" />
>
> <xsd:simpleType name="NumberType">
>   <xsd:restriction base="xsd:string">
>     <xsd:pattern value="[i][0-9]+" />
>   </xsd:restriction>
> </xsd:simpleType>
>
> Is the above xml schema consider using inheritance?

In a way. The NumberType is derived by restriction from xs:string. Put
another way, NumberType is a subtype of xs:string, and inherits its
properties (facets), aside from the xs:pattern facet, which is
overridden.

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/
Received on Tuesday, 23 September 2003 05:25:45 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:39 GMT