How to use the xpath.selectWithResolver function in xpath

To help you get started, we’ve selected a few xpath examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github SayMoreX / saymore-x / app / xmlUnitTestUtils.ts View on Github external
export function select(xpath: string) {
  if (resultDom === undefined) {
    throw new Error(
      "resultDom was undefined in select(). Make sure you called setResultXml()"
    );
  }
  try {
    const nodes = XPATH.selectWithResolver(
      xpath,
      resultDom
      //, resolver
    );
    return nodes;
  } catch (ex) {
    console.log("error in xpath: " + xpath);
    console.log(ex);
    throw new Error(`error in xpath: ${xpath} ${ex}`);
  }
}
github binduwavell / generator-alfresco / generators / common / xml-dom-utils.js View on Github external
getFirstNodeMatchingXPath: function (expression, docOrElement) {
    var match = xpath.selectWithResolver(expression, docOrElement, this.resolver, true);
    return match;
  },
github binduwavell / generator-alfresco / generators / common / xml-dom-utils.js View on Github external
selectMatchingXPath: function (expression, docOrElement) {
    var matches = xpath.selectWithResolver(expression, docOrElement, this.resolver, false);
    return matches;
  },

xpath

DOM 3 XPath implemention and helper for node.js and the web

MIT
Latest version published 1 year ago

Package Health Score

74 / 100
Full package analysis