W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > April to June 2000

Using derivedBy to define lists of permitted attribute values

From: Martin Bryan <mtbryan@sgml.u-net.com>
Date: Thu, 13 Apr 2000 12:15:46 +0100
Message-ID: <02c201bfa542$cbc25b40$57cc66c3@sgml>
To: <www-xml-schema-comments@w3.org>
I am trying to work out whether or not the derivedBy facet can be used to identify an element that contains a list of permitted values for an attribute. It seems to me to be a useful feature but I cannot see how it would work as the element referenced by derivedBy has, according to the Primer at least, and by implication from Part 2, to be in the instance and not in the schema. I was thinking about something along the following lines:

<xsd:attribute name=”Code” base=”xsd:string”>
 <xsd:simpleType name=”CodeList” base=”xsd:string” derivedBy=”xsd:list”/>
</xsd:attribute>
<MyCodeList xsi:type="CodeList">AB1 CD2 EF3</MyCodeList> 

Is this valid? Where would MyCodeList need to be defined? (Is it permitted as part of the Schema?)

Incidentally the examples shown in Part 2 and the Primer conflict. Part 2 shows the use of the xsi:type attribute to link the instance to the derived type. The example in the primer does not include this attribute. Some clearer explanation of the role of this attribute and the position of the element containing the list of permitted values, might help to clarify this point.

Another, unrelated, problem concerns the your listing of scale as a valid facet for integer based derived datatypes. Under what conditions is it valid to specify a scale property for an integer?

Martin Bryan
Project Leader
CEN/ISSS Electronic Commerce Workshop project on Defining and Mangaging Semantics and Datatypes
Received on Thursday, 13 April 2000 08:20:39 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:49:52 UTC