In every browser I tested the following works:
doc.getElementsByTagName("namespace:element")
HTMLUnit cannot find this, as its implementation:
388 public DomNodeList<htmlelement> getElementsByTagName(final String tagName) {
389 return new XPathDomNodeList<htmlelement>(this, ".//*[local-name()='" + tagName + "']");
390 }</htmlelement></htmlelement>
is wrong. Replacing "local-name()" with "name()" corrects this problem.
Can you provide a minimal html/js case that works differently?
Sure:
<namespace:element> </namespace:element> <script> var elements = document.getElementsByTagName("namespace:element"); document.write(elements.length === 1 ? "pass" : "fail"); </script>This test is valid for FF, but not for IE
You are right: There are two sets of Browsers.
In every MSIE (and derivates) document.getElementsByTagName("element") works and document.getElementsByTagName("namespace:element") does not.
In every other browser document.getElementsByTagName("element") does not work and document.getElementsByTagName("namespace:element") does.
I checked this with all browsers of http://browsershots.org .
Thanks for reporting, fixed in SVN