W3C home > Mailing lists > Public > xmlschema-dev@w3.org > May 2001

abstract simple content

From: GUSTIN Jean-Marc <jean-marc.gustin@swift.com>
Date: Mon, 14 May 2001 10:46:53 +0200
To: xmlschema-dev@w3.org
Message-id: <3AFF9B7D.C65BD336@swift.com>
I try to express the following.

I have a simple type "AccountNumber" which is a restriction on string.
I have 2 concrete types IBAN and BBAN that are based on AccountNumber.
It should not be possible to use "AccountNumber" but the derived types are valid.
As it is not possible to have abstract simple types I created a complex type with a simple content.
My schema is as follows:

<xs:schema xmlns:xs = "http://www.w3.org/2000/10/XMLSchema"
  elementFormDefault = "qualified">
 <xs:element name = "M" type = "M"/>
 <xs:complexType name = "M">
   <xs:element name = "AccountNumber" type = "AccountNumber"/>
 <xs:complexType name = "AccountNumber" abstract = "true">
   <xs:restriction base = "xs:string"/>
 <xs:complexType name = "IBAN">
   <xs:restriction base = "AccountNumber"/>
 <xs:complexType name = "BBAN">
   <xs:restriction base = "AccountNumber"/>

My validator accepts the schema mut don't validate the following instance:

<M xmlns:xsi = "http://www.w3.org/2000/10/XMLSchema-instance" xsi:noNamespaceSchemaLocation =
 <AccountNumber xsi:type="IBAN">value</AccountNumber>

Do you consider my schema and instance as correct?


Jean-Marc Gustin
Received on Monday, 14 May 2001 04:50:20 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:55:51 UTC