W3C home > Mailing lists > Public > www-dom@w3.org > July to September 2007

Re: Changing xmlns attribute on the fly.

From: <keshlam@us.ibm.com>
Date: Mon, 6 Aug 2007 10:29:08 -0400
Cc: www-dom@w3.org
Message-ID: <OF24692040.0C9F614C-ON8525732F.004F055C-8525732F.004F9296@lotus.com>

>So that means you can change the default namespace on the fly, and of
>all children that depend on it,

No. First off, as noted, you shouldn't be using setAttribute() at all these
days; switch to setAttributeNS. Ideally we should have deprecated the
non-namespace-aware methods, but the W3C has no deprecation mechanism and
we wanted to preserve them for backward compatability with DOM Level 1
applications which would require something like "conditional deprecation".

Second, since every element and attribute node carries its own namespace
information, even correctly changing/removing/adding a namespace
declaration has no effect on the other nodes; what it does mean is that
when you serialize the document back out to XML the serializer may have to
introduce other declarations to preserve these semantics, as described in
DOM Level 3's discussions of namespace normalization.

"... Three things see no end: A loop with exit code done wrong,
A semaphore untested, And the change that comes along. ..."
  -- "Threes" Rev 1.1 - Duane Elms / Leslie Fish
Received on Monday, 6 August 2007 14:31:09 UTC

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