Re: setting Node.prefix

Thanks, Philippe.

> Now, if you try to set the prefix with a null namespaceURI, you'll get
> a DOMException.NAMESPACE_ERR:

Right; I'm assuming (although I didn't state it) that one sets the namespace
URI first.

> There is no way to set the prefix on a DOM Level 1 node.

There is not, but I'm talking about setting the prefix on a DOM Level 2 node
that has been created with the DOM Level 1 method Document.createElement().
I can't find in the spec anywhere where it says one cannot set a prefix on
such an element. It does say that, "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." But
if this implies that the prefix cannot be set, is there an exception thrown,
or is the new prefix simply ignored?

> Node.nodeName is read only. You can't set it.

You're completely right. I was overthinking that...

Garret

Received on Friday, 22 December 2000 10:46:14 UTC