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

choices among attributes

From: David Wright <dawright@microsoft.com>
Date: Thu, 06 Mar 2003 11:33:38 -0700
Message-Id: <5.1.0.14.1.20030306113320.0252b8c8@localhost>
To: W3C XML Schema Comments list <www-xml-schema-comments@w3.org>

This is a request for the next version of XML-Schema. Please give a way to 
specify a choice among different attributes. For example, to say that

             <E a= foo />      <E b= bar />

are allowed, but

             <E a= foo b= bar />

isn t.



An easy way to do this is to allow <xsd:choice> to be used in a attribute 
specification.



Ideally, it would just be possible to use all the current containers for 
elements for attributes also. Then one could express complex, useful rules, 
such as E may have either attribute a or b. If it has a, it may also have 
c. If it has b, it must also have d.



I realize that, but using a child element instead of an attribute, I could 
achieve an equivalent result with the current XML-Schema spec. Not all of 
us attempting to validate documents using XML-Schema, though, have the 
possibility of changing the schema used in constructing them. We need to be 
able to express a rule that existed in someone s else s head, to whom it 
never occurred that the rule might some day need to be expressed in XML-Schema.
Received on Thursday, 6 March 2003 13:34:59 GMT

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