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 15:32:29 +0100
Message-ID: <033901bfa561$4ad2c140$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”>
 <xsd:simpleType name=”CodeList” base=”xsd:string” derivedBy=”xsd:list”/>
<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 11:58:54 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:08:47 UTC