Hi everbody
The DOM Level 2 Spec (page 44) defines NamedNodeMap Interface but it does not give a method to create a NamedNodeMap.
So the only use of NamedNodemap is through the Node interface where we have a member variable :
NamedNodeMap atributes;
ie the attributes belonging to a node can be assumed to be stored in a NamedNodeMap.
-------------------
The questions are :
1. Does all the attributes (specified or non-specified(ie those having default values)) belong to a node's NamedNodeMap
2 . The NamedNodeMap Interface has method item() (Refer Page 44 DOM Level 2 Core Specification ).
Quoting the spec :
The item() returns the indexth item in the map.If index is greater than
or equal to number of nodes in the map ,this returns NULL.
So can any order be assumed in the attributes belonging to the named node map.
3.What is the best usage scenario for the NamedNodeMap

NamedNodeMap Interface ( usage guidelines)
oolon
Many Many Thanks Mr Torr for the answers.
I have one more question.
If the default atribute values are not loaded, it means the style attributes will not be initialised to "initial" values.Is it right.
So are the "Initial" values not needed
ChEngGeoSun
Default values for built-in style and state attributes are defined in the spec when it comes to layout and rendering, but they are not part of the XML document and will not appear in the NamedNodeMap.
For the most part, the W3C-DOM view of the markup page and the HD DVD animation view of the markup page are quite distinct. If you query for an animated property that isn't specified, you will get the default value as defined in the spec. If you ask the DOM for that same attribute, you will get null.
TedViste
You are correct; you only get a NamedNodeMap by getting the attributes property.
1) The XML spec says that default values are added to the map if the attribute doesn't exist, but the HD DVD spec says that players must not load and use any schemas, hence you will never discover what the default values should be. So, for iHD, you will only get specified attributes
2) Attributes have no defined order. You could get them in any order. the item() method would most likely be used in a for loop to iterate over all the attributes. (from 0 to map.length- 1)
3) Most of the time you will just use node.getAttribute[NS](..) because you will know the name of the attribute you want to get. NamedNodeMap is really only good for enumarating attributes on a node when you don't really know what they are.