Hello,
I'm doing a bunch of document.evaluate then itering through each result with a for loop on result.snapshotLength.
Since I do the same thing inside each loop ( a thisDiv.parentNode.removeChild ) i would like to do just one loop.
I've read that :
The fifth parameter can be used to merge the results of two XPath queries. Pass in the result of a previous call to document.evaluate, and it will return the combined results of both queries
So I tried :
comDivs = document.evaluate(
"//div[@class='class name 1']",
document,
null,
XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,
null);
ggDivs = document.evaluate(
"//div[@class='class name 2']",
document,
null,
XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,
comDivs);
But this doesn't work (although i don't have an error log, it just doesn't work). What's the proper way of doing that ? Can i run different XPath queries and merge the results ? Or is there a way to pass regular expressions or some kind of alternation to the querry itself ?
The code i have for now is at : http://userscripts.org/scripts/review/58939
Thanks for your help !