- From: Henry S. Thompson <ht@cogsci.ed.ac.uk>
- Date: 09 Jan 2001 08:58:01 +0000
- To: Jim.Schneider@Level3.com
- Cc: xmlschema-dev@w3.org
Jim.Schneider@Level3.com writes:
> Is there a way to restrict an enumeration list based on the value of some
> other element/attribute value?
>
> For example (being new to XML schema, please forgive the syntax errors),
> given the example below, I would like to restrict the "LastName" attribute
> based on the value of the Party@Name attribute. In general, I would like
> "built-in" constraints/rules in my schema file. Is this possible?
> -----------------------------------------------------------
>
> <schema ...>
> <element name="Candidates">
> <element name="Party">
> <attribute name="Name" />
> </element>
> <element name="People">
> <attribute name="LastName">
> <simpleType>
> <enumeration value="Reagan" />
> <enumeration value="Bush" />
> <enumeration value="Clinton" />
> <enumeration value="Gore" />
> </simpleType>
> </attribute>
> </element>
> </element>
Sorry, run-time type construction == (attribute) co-constraints are
not provided by XML Schema 1.0 -- they are high on everyone's
requirements list for the next version.
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 Tuesday, 9 January 2001 03:58:06 UTC