W3C home > Mailing lists > Public > www-dom@w3.org > April to June 2001

DocumentAS.continuousValidityChecking in DOM Level 3 ASLS

From: Curt Arnold <carnold@houston.rr.com>
Date: Thu, 7 Jun 2001 22:06:33 -0500
Message-ID: <012f01c0efc8$36a0a810$2c021942@curtbnmqewb54k>
To: <www-dom@w3.org>
Throwing an exception either before or after document becomes invalid in a continuous checking mode seems problematic.  Trying to predict that a change would invalid an object would be difficult if there were unique or key/keyref constraints, then those constraints must look ahead to the tree to come.  Throwing an exception afterwards and leaving the tree in an invalid state isn't good either.

Throwing exceptions would also mean that only code that was specifically written to keep the tree always in compliance could be called once anyone had turned on continuous checking.  So if you had existing code that, for example, added required attributes after adding an element to the document temporarily making the document invalid, that code could not be called.

It seems that using events to notify on the transitions would be preferrable.  The event notifying that the document has become invalid could contain a reference to a DOMMutationEvent responsible for making the document invalid.  Code that made the document transitorily invalid could still be used, it would generate annoying events instead of breaking behaviors.
Received on Thursday, 7 June 2001 23:07:54 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:13:48 GMT