Re: Validity constraint: ID Attribute Default in XML Schema.

Although it is possible to declare an ID as optional it won't 
do you much good - as soon as you want to use the ID 
as a 'key' identity constraint you will probably find that its 
presence is no longer optional (you may not have the same 
problem with unique, however).

To deal with this sort of requirement you need to combine XSD
with something like Schematron:

http://www.ascc.net/xml/resource/schematron/schematron.html

I am finding I can manage some quite complex combined constraints 
using Schematron in my project. I struggled with key/keyrefs in 
XSD for ages and found I couldn't get them to do many of the things 
I wanted. I am now replacing all my key/keyref with Schematron 
rules, which are more flexible and powerful and allow me to specify 
my own error messages which means my users may even be able 
to understand them ! :-)

--
Gaz

Received on Friday, 2 November 2001 09:14:04 UTC