Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - Re: Any way to get node list by giving tagnames without prefixes >Thread Next - Re: Any way to get node list by giving tagnames without prefixes Re: Any way to get node list by giving tagnames without prefixesTo: NULL Date: 10/4/2005 5:10:00 PM
eva.mukhija@g... wrote:
> Sorry for typo .. the second method refers
> getElementsByTagNameNS("*",<tagname>)
The prefix does not matter, the namespace URI is what matters, and the
local name, see
<http://www.w3.org/TR/DOM-Level-2-Core/core.html#i-Document>
so all you need to know is the namespace URI of the elements you are
looking for (e.g. http://www.w3.org/1999/xhtml for XHTML elements) and
the local name (e.g. p for paragraph elements) then
document.getElementsByTagNameNS("http://www.w3.org/1999/xhtml", "p")
will give you all XHTML <p> elements, whether they are written as
<p xmlns="http://www.w3.org/1999/xhtml">
or
<pf1:p xmlns:pf1="http://www.w3.org/1999/xhtml">
in the markup does not matter.
--
Martin Honnen
http://JavaScript.FAQTs.com/
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
