That looks like it will do the job, thanks. (Not sure how I missed it - it's in the DOM 2 core spec as well - oops...)
The documentation says that this method is "Experimental - subject to change". Is this anything to worry about (i.e. is it really likely to be dropped in a later version)? What can change with this method? Thanks, Richard ----- Original Message ----- From: "Erik Rydgren" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, December 04, 2001 11:03 AM Subject: RE: Finding namespaces in DOM > DOM_Node::getNamespaceURI() should do the trick for you. > > Regards > > Erik Rydgren > Mandarinen systems AB > Sweden > > -----Original Message----- > From: Richard Jinks [mailto:[EMAIL PROTECTED]] > Sent: den 4 december 2001 11:46 > To: [EMAIL PROTECTED] > Subject: Finding namespaces in DOM > > > I'm currently using the DOM parser in Xerces-C 1.5.2 (W2000, VC6, SP5) > > Is there any way to identify all namespaces used in a DOM tree? > I've had a look through both DOM 2 Core spec, and the Xerces-C API, but > can't find anything useful. > I've found methods that allow you to find nodes with a given namespace, but > can't seem to find a way of determining the namespace from a given node, or > for finding all namespaces for all nodes. > > The DOM obviously has to store the namespaces somewhere, and keeping the > full namespace URI with each node isn't the most efficient use of memory, so > I'm hoping there's a nice list hidden in the background somewhere storing > all the namespaces. > > Failing this, if someone could point me in the direction of methods that can > get the namespace for a given element, I can always take the slow route of > going through all elements collecting the different namespaces myself. > > If all else fails, I'll have to hand-modify the DOM as I needed to do to get > character positions for the elements, but I'd like to avoid this if > possible. > > Thanks for any help, > Richard > > > _________________________________________________________ > Do You Yahoo!? > Get your free @yahoo.com address at http://mail.yahoo.com > > > --------------------------------------------------------------------- > 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] _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]