W3C home > Mailing lists > Public > xmlschema-dev@w3.org > June 2009

RE: [XML Schema 1.1] Conflicting <assert> elements ... who wins?

From: Michael Kay <mike@saxonica.com>
Date: Tue, 30 Jun 2009 14:13:09 +0100
To: "'Costello, Roger L.'" <costello@mitre.org>, <xmlschema-dev@w3.org>
Message-ID: <537016F3BE6D456B8864FD527172813B@Sealion>
> 
> Suppose one <assert> element says "The value of <Publisher> 
> must be a string no longer than 140 characters." 
> 
> Another <assert> element says "The value of <Publisher> must 
> be a string no longer than 70 characters."
> 

The assertions are "anded" together: the value must satisfy all of them. In
this case it means the value must be no longer than 70.

It's quite possible to have assertions that really conflict, e.g
test="string-length() > 100" and test="string-length() < 3". In that case
there are no valid instances. Indeed, it's possible to have a single
assertion that can never be satisfied, e.g. "string-length() < 0" or more
simply, test="false()"

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay 
Received on Tuesday, 30 June 2009 13:13:48 GMT

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