Node::prefix modification

(1) What exception (if any) should be thrown when setting the value of the prefix attribute on a node which does not admit a prefix, e.g., a Comment Node?

(2) DOM-2 (and 3) says [A] "Note that setting this attribute, when permitted, changes the nodeName attribute, which holds the qualified name, as well as the tagName and name attributes of the Element and Attr interfaces, when applicable" and [B] "For nodes of any type other than ELEMENT_NODE and ATTRIBUTE_NODE and nodes created with a DOM Level 1 method, such as createElement from the Document interface, this is always null." These two statements appear to be inconsistent in the following case:

Element e = doc.createElement("foo");
e.setPrefix("p");

According to [A], the above would change the nodeName and tagName of e to "p:foo" and change prefix to "p"; however, according to [B], prefix should be null.

Glenn

Received on Monday, 11 February 2002 16:24:38 UTC