- From: Curt Arnold <carnold@houston.rr.com>
- Date: Thu, 7 Jun 2001 22:06:33 -0500
- To: <www-dom@w3.org>
- Message-ID: <012f01c0efc8$36a0a810$2c021942@curtbnmqewb54k>
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 UTC