Skip to content

A pure JavaScript implementation and shim for the DOM Level 3 XPath specification.

License

Notifications You must be signed in to change notification settings

badeball/xpath-dom

Repository files navigation

xpath-dom

Sauce Test Status

A pure JavaScript implementation and shim for the DOM Level 3 XPath specification.

Usage in the browser

<!DOCTYPE html>
<html>
  <head>
    <script src="xpath-dom.shim.min.js"></script>
    <script>
      document.evaluate("//*", document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE);
    </script>
  </head>
</html>

Usage with Node

It works perfectly well together with jsdom.

var XPathEvaluator = require("xpath-dom");

XPathEvaluator.evaluate("//*", document, null, XPath.XPathResult.ORDERED_NODE_SNAPSHOT_TYPE);

Known issues

  • Namespaces are not yet supported.

  • The lang() function is not yet implemented.

  • The namespace-uri() function is not yet implemented.

About

A pure JavaScript implementation and shim for the DOM Level 3 XPath specification.

Resources

License

Stars

Watchers

Forks

Packages

No packages published