W3C home > Mailing lists > Public > www-dom@w3.org > October to December 2001


From: anu sha <anusha_2002gva@yahoo.com>
Date: Tue, 16 Oct 2001 22:25:49 -0700 (PDT)
Message-ID: <20011017052549.87365.qmail@web14704.mail.yahoo.com>
To: www-dom@w3.org

I am new to this mailing list.............
I am working with building a parser and implementing
DOM Level 1 and level 2 methods ............

I am facing some initial difficulties while using name

Kindly help me on this...

Basically,these are questions on how to implement the
following functions.(using C++)(and not usage of
existing parser).
 An attribute node has the following properties.
 1.Node.nodeName--(qualifiedName which contains
 localName optionally preceded by colon and namespace
 3.Node.prefix--(prefix extracted from qualifiedName)
 4.Node.localName--(local name,extracted from
 5.Node.nodeValue--(attibute's value)
 Now,in DOM Level 2 specification,it is given that,
 setNamedItemNS adds node using its namespaceURI and
 localName.In the NamedNodeMap,I maintain the key as
 string and value as pointer to attribute node.I want
 to know ,in the name-value pair of map whether the
 should be qualifiedName(prefix:localName)  or  we
 to concatenate localName,some delimiter(say,colon)
 namespaceURI and make it as key.
 In the first case,while implementing
 check if a node with that namespaceURI and localName
 is already present in this map,we have to check the
 namespaceURI and localName properties of each
 attribute node in the map(since key is
 qualifiedName,we can't check directly by the key).
 But as said in the second case,if we make the key of
 the NamedNodeMap by concatenating localName,: and
 namespaceURI ,then the properties namespaceURI and
 localName of the argument Node can be concatenated in
 the same way and checked directly whether it matches
 with the key.
 Sameway,if the key of NamedNodeMap is going to be
 in setAttributeNS(namespaceURI,qualifiedName,value)
 an attribute with the same localName and namespaceURI
 is already present on the element ,its prefix has to
 be changed to the prefix part of the
 nodeName has to be changed to argument qualifiedName
 and also the prefix part of the key of NamedNodeMap
 has to be changed.Another thing is ,if we have
 qualifiedName as key of namedNodeMap,then it's
 possible for  attribute node entries with the same
 local name and namespaceURI but different prefix to
 present in the NamedNodeMap which may be misleading
 because even if the prefix is different ,the
 are not unique .(since their localName and
 namespaceURI are same).
 If the key of NamedNodeMap is formed by concatenating
 localName,: and namespaceURI,then in the
 of setAttributeNS ,if an attribute with the same
 localName and namepsaceURI is already present on the
 element ,is prefix has to be changed to the prefix
 part of the qualifiedName,its nodeName has to be
 changed to the qualifiedName argument and also its
 value.in this case,we'll not have multiple entries
 attributes with different prefix but same localName
 and namespaceURI.
 So,please tell me,according to DOM specification what
 should be the key of NamedNodeMap?Is it
 qualifiedName(two-part name containing prefix and
  localName) or two-part name
  containing localName and namespaceURI?


thanks and regards

Do You Yahoo!?
Make a great connection at Yahoo! Personals.
Received on Wednesday, 17 October 2001 01:25:50 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:09 UTC