Using derivedBy to define lists of permitted attribute values

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”/>
</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 11:58:54 UTC