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

Final clause in attributes

From: Roman Rytov <roman@davinci.co.il>
Date: Mon, 4 Jun 2001 11:24:17 +0200
Message-ID: <6F8B2136D80AD411A37A0050DA61D520651DF3@LEONARDO>
To: "'xmlschema-dev@w3.org'" <xmlschema-dev@w3.org>
I was trying to create a list of acceptable attribute values for my element.
Like in  Enumeration Facet example I made following:

<xsd:simpleType name="RequestType" final="restriction">
                <xsd:restriction base="xsd:string">
                        <xsd:enumeration value="Set"/>
                        <xsd:enumeration value="Get"/>

After that I want to use this list in one of my element's attributes values:

<xsd:complexType name="Header">
                        <xsd:element name="Info" type="xsd:string"/>
            <xsd:attribute name="Type" type="RequestType" use="required"

but during validation the schema I get the next error message:

The type 
    <xsd:restriction base="RequestType"/>
was defined by restriction on the type RequestType. But according to the
definition of type RequestType (in the final attribute), 
it cannot be refined using the derivation method, restriction. To fix this
problem, either define 
    <xsd:restriction base="RequestType"/>
 without reference to RequestType, or remove or modify the final clause in
the definition of RequestType.

As you can see I didn't define another <simpleType> I just wanted to use
previously created type (RequestType) as type of my attribute (Type). What's
the problem? 

Basically I want to create a list of available values (to use as attribute
values) and restrict this list completely.
Received on Monday, 4 June 2001 05:22:55 UTC

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