Which Exception should be raised when multiple codes are possible

Hi,

In DOM Level 2 Core, it is not clear which of several possible Exceptions
a method should raise.

Example:

DocumentType::replaceChild (inherited from Node)

Possible exception codes listed in the recommendation are
HIERARCHY_REQUEST_ERR, WRONG_DOCUMENT_ERR, NO_MODIFICATION_ALLOWED_ERR,
NOT_FOUND_ERR.

Supposed that newChild is from the right document, all error conditions
except WRONG_DOCUMENT_ERR apply. (DocumentType is always readonly)

Which of these exception codes should be chosen, and what is the rule that
should be followed here? (DocumentType::replaceChild is far from being the
only method affected)

Thanks for any suggestions,

Tobias Peters

Received on Saturday, 27 October 2001 16:05:58 UTC