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

What is the DOM4 Attr interface used for?

From: Roy Walmsley <roy.walmsley@ntlworld.com>
Date: Wed, 17 Feb 2016 15:39:11 -0000
To: <www-dom@w3.org>
Message-ID: <001501d16999$5983aed0$0c8b0c70$@ntlworld.com>
Hello all,


I, as a DOM novice, have been studying the DOM4 specification available
on-line at https://www.w3.org/TR/dom/.


I see the definition of the "Attr" interface at section 4.8.1. What I do not
see is any usage of this interface. There is the statement that "Attr"
objects are simply known as attributes.


I ask the further question, how are element attributes defined? I see the
"Element" interface defined in section 4.8. It has an attribute "attributes"
of type "NamedNodeMap".


Further, I note in section 8.2 that the interface "Attr" no longer inherits
from "Node", and is completely changed.


I make the assumption that, previously, individual "Element" attributes were
defined as "Attr" objects which, inheriting the "Node" interface, could be
listed in a "NamedNodeMap" attribute.


Now, however, it seems to me, that "NamedNodeMap" is not an appropriate type
for the "attributes" attribute in the "Element" interface.


As I said at the start, I am a novice to the DOM, albeit that I have many
years programming experience. So, apologies if I have this wrong. I would be
very grateful for clarification.




Roy Walmsley
Received on Friday, 19 February 2016 10:36:01 UTC

This archive was generated by hypermail 2.3.1 : Friday, 19 February 2016 10:36:05 UTC