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

Overriding of a fixed value

From: Maikel Jansen <maikel.jansen@asml.com>
Date: Fri, 7 Dec 2001 08:11:09 -0500 (EST)
Message-ID: <3C10BFD8.2AE914B9@asml.nl>
To: xmlschema-dev@w3.org
Dear XML-Schema users,

I have a question about overriding fixed values.

Consider the following complex type definition:

<xs:complexType name="type0">
    <xs:extension base="int"/>
  <xs:attribute name="description" fixed="a description"/>

Now, I want to express a type called type1 in an XML schema, such that
is an inheritance type of type0 and type1 overrides the (fixed) value of
attribute 'desc' of type0. 

A straightforward solution would be:

<xs:complexType name="type1">
    <xs:restriction base="type0"/>
  <xs:attribute name="description" fixed="another description"/>

However, this seems not to be correct because the following XML document
contains an element ('x') of type1 is not a correct instance:

</x> <-- unexpected character literal

I am using the msv-20010910 validator.

Does anyone know if it is possible to express overriding of (fixed)
values in an XML Schema? An if so, how I can do it?

Thanks in advance,

Maikel Jansen.
Received on Saturday, 8 December 2001 15:33:02 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:14:56 UTC