W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > April to June 2009

[Bug 5023] Relationship between identity constraints and assertions

From: <bugzilla@wiggum.w3.org>
Date: Tue, 14 Apr 2009 23:05:14 +0000
To: www-xml-schema-comments@w3.org
Message-Id: <E1Ltrgo-0002sE-0B@wiggum.w3.org>
http://www.w3.org/Bugs/Public/show_bug.cgi?id=5023


Michael Kay <mike@saxonica.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mike@saxonica.com




--- Comment #9 from Michael Kay <mike@saxonica.com>  2009-04-14 23:05:13 ---
If we're advising users which of these mechanisms to use under which
circumstances, then I think there are two observations I would want to make:

(a) it's a lot easier for an implementation to enforce identity constraints and
CTA while processing the document in a streaming manner than it is to enforce
assertions

(b) using a specialized mechanism such as identity constraints rather than a
general mechanism like assertions may result in a more focused and intelligible
error message when the condition is violated. For example, the assertion
test="count(//empno)=count(distinct-values(//empno))" is unlikely, if violated,
to result in an error message that tells the user how many duplicate employee
numbers there are, which numbers are duplicated, or where to look for them in
the instance document. I think the same is probably true of other reasonable
ways of expressing this constraint, such as test="every $a in //empno, $b in
//empno satisfies $a is $b or $a ne $b"


-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
Received on Tuesday, 14 April 2009 23:05:22 GMT

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