You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@xerces.apache.org by Indrajit Chaudhuri <In...@catsglobal.co.in> on 2000/02/24 13:49:34 UTC

Help required in setting an attribute in the DOM tree!!

Hi,

I am trying to set an attribute for an element in the DOM tree. What I
am doing is that :
* after parsing the document, I am getting a DOM_Document.
* from the document I am retrieving the elements corresponding to a
particular name in a DOM_NodeList using getElementsByTagName() method.
* now I can only retrieve DOM_Node from the nodelist using the item()
method. I can't find any method to retrieve the DOM_Elements from the
nodelist. Also I was not able to cast the DOM_Node into a DOM_Element. 
* as such, I can't set the attribute using the setAttribute() method.

How can I set the attribute in the element? Is there any way out? TIA
for any help in this regard.

Thanks,
Indrajit