Re: createProcessingInstruction and 'xml'

>Should createProcessingInstruction raise INVALID_CHARACTER_ERR when called
>with a 'xml' target? Or doesn't the DOM API enforce this rule?

At this time, the DOM spec does not enforce this rule. Some DOMs are in
fact (ab)using PIs as a stopgap representation for the XML Declaration and
Text Declaration, pending the official solution expected in DOM Level 3.

There are definitely borderline cases where the DOM does not continuously
enforce well-formedness. Some of them are deliberate, to allow flexibility
for editing or for reapplying the DOM to non-XML documents; some are
untested for performance reasons. One of the things we're looking at in
Level 3 is adding operations that will allow users to request that a node
or subtree be tested against a stricter set of well-formedness rules.

______________________________________
Joe Kesselman  / IBM Research

Received on Thursday, 1 February 2001 13:42:06 UTC