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

Re: Final clause in attributes

From: Eddie Robertsson <eddie@allette.com.au>
Date: Tue, 05 Jun 2001 10:38:10 +1000
Message-ID: <3B1C29F2.70F7FF4E@allette.com.au>
To: Roman Rytov <roman@davinci.co.il>
CC: "'xmlschema-dev@w3.org'" <xmlschema-dev@w3.org>
Hi Roman,

Roman Rytov wrote:

> 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"/>
>                 </xsd:restriction>
> </xsd:simpleType>
>
> After that I want to use this list in one of my element's attributes
> values:
>
> <xsd:complexType name="Header">
>         <xsd:sequence>
>                         <xsd:element name="Info" type="xsd:string"/>
>             </xsd:sequence>
>             <xsd:attribute name="Type" type="RequestType"
> use="required" fixed="Set"/>
> </xsd:complexType>

If the above declaration are the only ones you with regards to the
RequestType (that is you don't have any restrictions later on in your
schema) then it is a valid schema. What validator are you using to get
the error message below? It seems strange to me that you get that error
message if you're not trying to restrict the RequestType.

/Eddie

> but during validation the schema I get the next error message:
>
> The type
> <xsd:simpleType>
>     <xsd:restriction base="RequestType"/>
> </xsd:simpleType>
> 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:simpleType>
>     <xsd:restriction base="RequestType"/>
> </xsd:simpleType>
>  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 20:38:39 GMT

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