What is the DOM4 Attr interface used for?

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.

 

Regards,

 

Roy Walmsley

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