setting Node.prefix

The documentation for Node.prefix says that Node.prefix will always be null
if (for example) an element was created with DOM Level 1
Document.createElement(). Yet there seems to be no restriction in setting
the prefix (Node.setPrefix()) after the node is created. In this case, it
appears the Node.name property is changed as well to reflect the new prefix.

I don't think it's clear what exactly happens to the related namespace
values in this case. For example:

1. In all elements, does setting Node.nodeName update Node.prefix? (Why not?
The converse is true, after all.)

2. In all elements, does setting Node.nodeName update Node.localName? (If #1
is true, then this should be the case for consistency.)

3. If #1 and #2 are true, then setting the prefix of an Element created with
DOM Level 1 to a non-null value *should* update Node.localName as well,
right?

In other words, I would assume that, if the following takes place, the
corresponding value changes will occur):

Step 1: Document document=myDocument.createElement("myNS:myElement")
{nodeName="myNS:myElement"; prefix=null; localName=null;}

Step 2: myDocument.setPrefix("yourNS") {nodeNS="yourNS:myElement";
prefix="yourNS"; localName="myElement"}

This seems logical to me, but it's not stated in the DOM Level 2 Core
Specification Version 1.0. Are my assumptions correct?

Garret

Received on Friday, 22 December 2000 10:15:21 UTC