Browse Source

Added support for non-prefixed default namespace selectors

mshwed 6 năm trước cách đây
mục cha
commit
3412372d1e
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  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;
         try {
-            nodes = xpath.select(query, doc);
+            nodes = xpath.parse(query).select({ node: doc, allowAnyNamespaceForNoPrefix: true });
         } catch (err) {
             throw new OperationError(`Invalid XPath. Details:\n${err.message}.`);
         }