浏览代码

Added support for non-prefixed default namespace selectors

mshwed 6 年之前
父节点
当前提交
3412372d1e
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/core/operations/XPathExpression.mjs

+ 1 - 1
src/core/operations/XPathExpression.mjs

@@ -57,7 +57,7 @@ class XPathExpression extends Operation {
 
 
         let nodes;
         let nodes;
         try {
         try {
-            nodes = xpath.select(query, doc);
+            nodes = xpath.parse(query).select({ node: doc, allowAnyNamespaceForNoPrefix: true });
         } catch (err) {
         } catch (err) {
             throw new OperationError(`Invalid XPath. Details:\n${err.message}.`);
             throw new OperationError(`Invalid XPath. Details:\n${err.message}.`);
         }
         }