W3C home > Mailing lists > Public > xmlschema-dev@w3.org > January 2001

Re: [Moderator Action] Using attributes to define scope

From: Henry S. Thompson <ht@cogsci.ed.ac.uk>
Date: 05 Jan 2001 09:29:18 +0000
To: Jesse Watson <jesse.watson@Par3.com>
Cc: "'xmlschema-dev@w3.org'" <xmlschema-dev@w3.org>
Message-ID: <f5br92icpox.fsf@cogsci.ed.ac.uk>
Jesse Watson <jesse.watson@Par3.com> writes:

> I'm reviewing XML Schema as a replacement for DTDs currently used at our
> company and can't find a way to do the following:
> 
> Given the below XML, I want to validate that the value of the 'y'
> element's 'name' attribute is legal depending on the scope in which
> it is found.  The tricky part is that I want the scope to be
> determined by the value of one of an element's attributes, rather
> than by it's name!  For example, if the 'y' element is within the
> (root) 'z' element, only the value "Pat" is legal in the 'y'
> element's name attribute.  But if the 'y' element is within the 'x'
> element AND the 'x' element's 'foo' attribute's value is "boyNames",
> then the legal enumeration of values is "Mark", "John", "Mike" as
> well as "Pat". Etcetera and so on for "girlNames".

Runtime/computed types, or co-constraints, are a commonly requested
absent feature from XML Schema v1.0, sorry.  Strong candidate for
v1.1.

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 Friday, 5 January 2001 04:29:26 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:19 GMT