W3C home > Mailing lists > Public > www-dom@w3.org > October to December 2000

Re: setting Node.prefix

From: Philippe Le Hegaret <plh@w3.org>
Date: Fri, 22 Dec 2000 17:14:05 +0100
Message-ID: <3A437DCD.CB445066@w3.org>
To: www-dom list <www-dom@w3.org>
"Fred L. Drake, Jr." wrote:
> Garret Wilson writes:
>  > Right; I'm assuming (although I didn't state it) that one sets the namespace
>  > URI first.
>   The namespaceURI attribute is read-only in DOM Level 2.
>  > 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?
>   I would expect to get either and NAMESPACE_ERR or a

As I said, you'll get a NAMESPACE_ERR DOMException if you try to set the prefix
a null namespaceURI. The recommendation is clear on that point. prefix will
be null for a DOM Level 1 node and there is no way to change that.
And Fred is right, there is no way to change the namespaceURI of a Node after
his creation: the Node.namespaceURI attribute is read-only.

Received on Friday, 22 December 2000 11:14:11 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:07 UTC