Oops, you're (mostly) right. I looked at the index of the DOM 2 Core spec, and missed the link for the method pointing to Element. (It's also a Document method.) I've been thinking it was a Document method only for a long time. You learn something every day...
-----Original Message----- From: Jorge Pozo Ramirez [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 18, 2001 12:16 PM To: [EMAIL PROTECTED] Subject: Re: Class Casting DOM_Element / DOM_Node As the docs stats, getElementsByTagName() method is part of the Element Class, not of the Document class. Is this standard casting method safe for memory deallocating and such things? > Of course, you won't be able to use getElementsByTagName() on the resulting > element, since it's a document method, not an element method. > > DOM_TreeWalker might be suited to your problem. > > -----Original Message----- > From: Murphy, James [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, December 18, 2001 11:50 AM > To: '[EMAIL PROTECTED]' > Subject: RE: Class Casting DOM_Element / DOM_Node > > > DOM_Node aNode = aNodeList.item(0); > if (aNode.getNodeType() != DOM_Node::ELEMENT_NODE) > punt; > > DOM_Element aElement = (DOM_Element&)aNode; > > Regards, > Jim > > > -----Original Message----- > > From: Jorge Pozo Ramirez [mailto:[EMAIL PROTECTED]] > > Sent: Tuesday, December 18, 2001 11:54 AM > > To: [EMAIL PROTECTED] > > Subject: Class Casting DOM_Element / DOM_Node > > > > > > Hi there. > > > > I have a DOM_Element, and I use getElementsByTagName(), so I get a > > DOM_NodeList. > > > > For each node within this list, I want to do another search like > > getElementsByTagName(), but as DOM_NodeList.item(i) returns a > > DOM_Node, > > (that lacks the getElementsByTagName() method), how can I > > cast the DOM_Node > > returned by NodeList.item(i) into a DOM_Element? > > > > Thanks. > > > > Jorge > > > > > > > > ********************************************************************** > > Este mensaje ha sido analizado con una herramienta de > > deteccion de virus para su seguridad. > > > > Ministerio de Justicia > > www.mju.es > > ********************************************************************** > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] ********************************************************************** Este mensaje ha sido analizado con una herramienta de deteccion de virus para su seguridad. Ministerio de Justicia www.mju.es ********************************************************************** --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
