What is the DOM4 Attr interface used for?
"Roy Walmsley" <[email protected]> Wed, 17 Feb 2016 15:39:11 -0000
| Newsgroups | gmane.comp.web.dom.general |
|---|---|
| Message-ID | <[email protected]> |
This is a multipart message in MIME format.
------=_NextPart_000_0016_01D16999.59853570
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit
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
------=_NextPart_000_0016_01D16999.59853570
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
<html xmlns:v=3D"urn:schemas-microsoft-com:vml" =
xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" =
xmlns=3D"http://www.w3.org/TR/REC-html40"><head><meta =
http-equiv=3DContent-Type content=3D"text/html; =
charset=3Dus-ascii"><meta name=3DGenerator content=3D"Microsoft Word 14 =
(filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri","sans-serif";
color:windowtext;}
..MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]--></head><body lang=3DEN-GB link=3Dblue =
vlink=3Dpurple><div class=3DWordSection1><p class=3DMsoNormal>Hello =
all,<o:p></o:p></p><p class=3DMsoNormal><o:p> </o:p></p><p =
class=3DMsoNormal>I, as a DOM novice, have been studying the DOM4 =
specification available on-line at <a =
href=3D"https://www.w3.org/TR/dom/">https://www.w3.org/TR/dom/</a>.<o:p><=
/o:p></p><p class=3DMsoNormal><o:p> </o:p></p><p =
class=3DMsoNormal>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.<o:p></o:p></p><p =
class=3DMsoNormal><o:p> </o:p></p><p class=3DMsoNormal>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”.<o:p></o:p></p><p =
class=3DMsoNormal><o:p> </o:p></p><p class=3DMsoNormal>Further, I =
note in section 8.2 that the interface “Attr” no longer =
inherits from “Node”, and is completely =
changed.<o:p></o:p></p><p class=3DMsoNormal><o:p> </o:p></p><p =
class=3DMsoNormal>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.<o:p></o:p></p><p =
class=3DMsoNormal><o:p> </o:p></p><p class=3DMsoNormal>Now, =
however, it seems to me, that “NamedNodeMap” is not an =
appropriate type for the “attributes” attribute in the =
“Element” interface.<o:p></o:p></p><p =
class=3DMsoNormal><o:p> </o:p></p><p class=3DMsoNormal>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.<o:p></o:p></p><p =
class=3DMsoNormal><o:p> </o:p></p><p =
class=3DMsoNormal>Regards,<o:p></o:p></p><p =
class=3DMsoNormal><o:p> </o:p></p><p class=3DMsoNormal>Roy =
Walmsley<o:p></o:p></p></div></body></html>
------=_NextPart_000_0016_01D16999.59853570--