Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

getTagName in Element Interface

 
Andy Smith
Ranch Hand
Posts: 239
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
getTagName is the method in Element interface to perform the functionality as perfrormed by getNodeName in Node Interface Then wats is the need for this method??

Just to give clarity of funcationality by providing a more suitable name?
 
Hari Vignesh Padmanaban
Ranch Hand
Posts: 578
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Andy Smith:
getTagName is the method in Element interface to perform the functionality as perfrormed by getNodeName in Node Interface Then wats is the need for this method??

Just to give clarity of funcationality by providing a more suitable name?


Hi Andy,
I guess that u are speking abt DOM 2.0.

The DOM 2.0 API has only the following methods defined in the IDL for "Node"

Node insertBefore(in Node newChild, in Node refChild)raises(DOMException);
Node replaceChild(in Node newChild, in Node oldChild) raises(DOMException);
Node removeChild(in Node oldChild) raises(DOMException);
Node appendChild(in Node newChild) raises(DOMException);
boolean hasChildNodes();
NodecloneNode(in boolean deep);
// Modified in DOM Level 2:
void normalize();
// Introduced in DOM Level 2:
boolean isSupported(in DOMString feature, in DOMString version);
boolean hasAttributes();



It does not have a getNodeName() method !!

It does have an attribute called nodeName.


readonly attribute DOMString nodeName;



BUT NO METHOD.

And its the same with the element interface !!! there is no method called getTagName() !! the only closest definition in the element IDL is

NodeList getElementsByTagName(in DOMString name);


I think its the implementation part that has these additional methods !!! The particular DOM parser that you are using might have the methods you mentioned. But these are not specified by the DOM 2.0 Specifications by w3.org.

To see the DOM 2.0 specs visit
http://www.w3.org/TR/DOM-Level-2-Core/idl-definitions.html

Hope this clears your doubt !!!

Hari

[ December 17, 2004: Message edited by: Hari Vignesh Padmanaban ]
[ December 17, 2004: Message edited by: Hari Vignesh Padmanaban ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic