W3C home > Mailing lists > Public > xmlschema-dev@w3.org > August 2002

Re: Inheritance of restriction facets?

From: Eddie Robertsson <erobertsson@allette.com.au>
Date: Fri, 02 Aug 2002 11:59:12 +1000
Message-ID: <3D49E770.9080608@allette.com.au>
To: zze-MARCHEGAY Michael stagiaire FTRD/DTL/LAN <michael.marchegay@rd.francetelecom.com>
CC: xmlschema-dev@w3.org

Hi Michael,

>I have a question concerning restriction facets. 
>When a derivation by restriction of a simpleType is performed, are 
>the facets of the base type inherited by the deriving type?
>
Yes, the facets on the base type are still enforced for the derived 
types which makes your example below invalid.

>For example, which content do the following schema allow for bar element?
>  - A, AA and AAA?
>  - AA and AAA?
>  - ...?
>
It will never come to this since the schema below is invalid and hence 
can't be used to validate a document.

><schema>
>  <simpleType name="foo">
>    <restriction base="string">
>      <minLength value="2"/>
>    </restriction>
>  </simpleType>
>
>  <element name="bar">
>    <simpleType>
>      <restriction base="foo">
>        <enumeration value="A"/>
>
This is the enumeration value that is invalid. If you remove "A" your 
schema is fine.

>        <enumeration value="AA"/>
>        <enumeration value="AAA"/>
>      </restriction>
>    </simpleType>
>  </element>
></schema>
>
>Thanks.
>
Cheers,
/Eddie
Received on Thursday, 1 August 2002 21:44:02 GMT

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