Re: Using derivedBy to define lists of permitted attribute values

"Martin Bryan" <mtbryan@sgml.u-net.com> writes:

> Henry
> 
> Thanks for the response, but you are on the wrong track. I see how
> constraining element content works quite nicely. The problem was
> that I specifically want to apply the same technique to an
> enumerated list of attribute values, hence my question:
> 
> > 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.
> 
> The area I am trying to get working is the ebXML electronic business
> area. We have a lot of elements which have "qualifier" attributes
> whose values are taken from code lists. Ideally I would like to be
> able to "import" up-to-date codelists as part of the schema so that
> maintenance of the code list can be made independent of maintenance
> of the schema. Having to define such lists as enumeration lists is
> very long winded, so I would like to use the derived by method, but
> I don't see how it applies to attribtues, hence my attempted
> example:
> 
> > <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> 
> 

What confuses my about your example is that you don't show an
attribute in the instance, but rather an element.  Your schema
fragment, if it appeared within the type definition for the <banana>
element, would schema-validate the following instance just fine:

<banana Code='AB1 CD2 EF3'>...</banana>

Is what you want to be able to do is restrict the list elements to
some enumerated list defined elsewhere?

ht
-- 
  Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
          W3C Fellow 1999--2001, part-time member of W3C Team
     2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
	    Fax: (44) 131 650-4587, e-mail: ht@cogsci.ed.ac.uk
		     URL: http://www.ltg.ed.ac.uk/~ht/

Received on Thursday, 13 April 2000 13:03:09 UTC