// function name() does not work with attribute nodes
var strXML = '<data><record id="-a-" a="v">???</record><record
var doc = (new DOMParser()).parseFromString(strXML, "text/xml");
var xpe = new XPathEvaluator();
var objResult = xpe.evaluate("//@*[name()='id']", doc, null, 0, null);
var itm = null;
var objNodes = ;
while (itm = objResult.iterateNext()) objNodes.push(itm);
assertEquals(2, objNodes.length); // Safari yields 0
Created attachment 12715 [details]
Created attachment 12723 [details]
Changed the wording of comments in the test a bit - the way name() works with a document that didn't have namespace normalization applied to it may be actually correct (at least, I couldn't find any indication that XPathEvaluator is supposed to normalize the document itself).
Comment on attachment 12723 [details]
Should that be prefix.isEmpty() instead of prefix.isNull()? Is it possible to construct a test that would behave differently depending on which you used?
In general, I recommend taking advantage of the null value as distinct from empty only when it's necessary, so if either would work the same I'd prefer isEmpty.
Committed revision 19226.
(In reply to comment #3)
> Should that be prefix.isEmpty() instead of prefix.isNull()? Is it possible to
> construct a test that would behave differently depending on which you used?
I don't know how to make such a test; changed to isEmpty().