Only nodes in body selected
Brought to you by:
hmehdi
It seems that one can only select nodes in the body node. Tested with the following call:
document.evaluate("//*", document.getElementsByTagName('html')[0], null, XPathResult.ANY_TYPE, null);
The script-tags in the head are excluded.
Logged In: YES
user_id=1555492
Originator: NO
Same problem here. Looks like somewhere the documentElement is being replace by a child or something? Didn't have time to search through the whole code.
Result can be checked by editing line 422:
if (result._isNodeSet)
{ alert(document._XPathMsxmlDocumentHelper.getDom().documentElement.nodeName);
result._domResult = document._XPathMsxmlDocumentHelper.getDom().selectNodes(expression);
}
An update would be very welcome. Thanks for the script anyway, works great :)
Logged In: YES
user_id=1555492
Originator: NO
I've checked the code and written a simple fix. I don't know why the old code was formed this way, but I tested it and I think the change has no other consequences:
Replace on line 546 the old code:
function loadDocument(dom, helper)
{
return loadNode(dom, dom, document.body, helper);
}
with the new code:
function loadDocument(dom, helper)
{
return loadNode(dom, dom, document.documentElement, helper);
}
Enjoy :)