W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > January to March 2001

Re: Inconsistency between Primer and Structures

From: Henry S. Thompson <ht@cogsci.ed.ac.uk>
Date: 30 Jan 2001 12:54:28 +0000
To: afo@zurich.ibm.com
Cc: www-xml-schema-comments@w3.org
Message-ID: <f5b4ryhnqt7.fsf@cogsci.ed.ac.uk>
I sympathise with your plight.  As soon as XPath supports types, it
will be easy to do what you want -- just used a type-based XPath for
your three selectors.

Until then I recommend the following:  Put a fixed attribute
declaration for an attribute called e.g. namespaceName on each of your 
three core types, i.e.

  <attribute name="namespaceName" type="token" use="fixed" value="Sensor"/>
  <attribute name="namespaceName" type="token" use="fixed" value="Location"/>
  <attribute name="namespaceName" type="token" use="fixed" value="Component"/>

This will be inherited by all subtypes, and appear in the infoset for
all instances.  Then your unique's can be

  <xs:unique name="UniqueSensors">
   <xs:selector xpath="//*[@namespaceName='Sensor']"
   <xs:field xpath="@name"/>
 </xs:unique>

etc.

Hope this helps

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, 30 January 2001 07:54:31 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Sunday, 6 December 2009 18:12:49 GMT