Support namespaces in ZU.xpath in IE
This commit is contained in:
parent
009e315fa1
commit
0e2cf3146f
1 changed files with 8 additions and 0 deletions
|
@ -991,6 +991,14 @@ Zotero.Utilities = {
|
|||
} else if("selectNodes" in element) {
|
||||
// We use JavaScript-XPath in IE for HTML documents, but with an XML
|
||||
// document, we need to use selectNodes
|
||||
if(namespaces) {
|
||||
var ieNamespaces = [];
|
||||
for(var i in namespaces) {
|
||||
if(!i) continue;
|
||||
ieNamespaces.push('xmlns:'+i+'="'+Zotero.Utilities.htmlSpecialChars(namespaces[i])+'"');
|
||||
}
|
||||
rootDoc.setProperty("SelectionNamespaces", ieNamespaces.join(" "));
|
||||
}
|
||||
var nodes = element.selectNodes(xpath);
|
||||
for(var i=0; i<nodes.length; i++) {
|
||||
results.push(nodes[i]);
|
||||
|
|
Loading…
Reference in a new issue