W3C home > Mailing lists > Public > www-dom@w3.org > January to March 2006

DOM3 Core: removing unspecified attributes

From: Bjoern Hoehrmann <derhoermi@gmx.net>
Date: Sat, 25 Mar 2006 20:50:34 +0100
To: www-dom@w3.org
Message-ID: <2b6b22197ml4bi45489iglpit5a5f9t8m5@hive.bjoern.hoehrmann.de>

Hi,

  I think DOM Level 3 Core is not entirely clear about how attribute
changes affect the DOM if there are default values. The main text is

  If the attribute was not explicitly given a value in the instance
  document but has a default value provided by the schema associated
  with the document, an attribute node will be created with specified
  set to false. Removing attribute nodes for which a default value is
  defined in the schema generates a new attribute node with the default
  value and specified set to false.

Consider a case like

  <!DOCTYPE foo [
    <!ELEMENT foo EMPTY>
    <!ATTLIST foo bar CDATA 'baz'>
  ]><foo/>

Now

  foo.removeAttributeNS(null, 'bar');

I am not sure whether the new Attr node will be created in this case,
or whether the text applies only when .specified is true. I think this
should be considered a no-op but it should be clarified either way.

regards,
-- 
Björn Höhrmann · mailto:bjoern@hoehrmann.de · http://bjoern.hoehrmann.de
Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de
68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/ 
Received on Saturday, 25 March 2006 19:50:27 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 June 2012 06:13:58 GMT