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:simpleContent>
    <xs:extension base="int"/>
  </xs:simpleContent>
  <xs:attribute name="description" fixed="a description"/>
</xs:complexType>

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

A straightforward solution would be:

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

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

<x>
  3
</x> <-- unexpected character literal

I am using the msv-20010910 validator.

Does anyone know if it is possible to express overriding of (fixed)
attribute 
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 GMT

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