Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Generated on May 29, 2024 via pnpm

xpath 0.0.23

DOM 3 Xpath implemention and helper for node.js.
Package summary
Share
2
issues
1
high severity
license
1
1
low severity
license
1
1
license
1
Creative Commons
Package created
20 Aug 2012
Version published
9 Apr 2016
Maintainers
2
Total deps
1
Direct deps
0
License
Creative Commons

Issues

2

1 high severity issue

high
Recommendation: Validate that the package complies with your license policy
via: xpath@0.0.23
Collapse
Expand

1 low severity issue

low
Recommendation: Read and validate the license terms
via: xpath@0.0.23
Collapse
Expand

Licenses

Creative Commons

Invalid
Not OSI Approved
1 Packages, Including:
xpath@0.0.23
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

0
All Dependencies CSV
β“˜ This is a list of xpath 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does xpath do?

The xpath npm package provides a DOM 3 XPath 1.0 implementation along with helper functions for use with JavaScript, extending support to node.js as well. At its core, it allows for efficient querying and navigation of XML documents.

How do you use xpath?

To use xpath, you first need to install the package via npm using npm install xpath. An xml engine is required in conjunction with xpath, for which the authors recommend xmldom and it can be installed using npm install @xmldom/xmldom.

You can import the necessary modules in your code with require statements: var xpath = require('xpath'); and var dom = require('@xmldom/xmldom').DOMParser;. Then you can use the xpath.select() function to run XPath queries on your XML documents.

Here's an example usage:

var xpath = require('xpath');
var dom = require('@xmldom/xmldom').DOMParser;

var xml = "<book><title>Harry Potter</title></book>";
var doc = new dom().parseFromString(xml, 'text/xml');
var nodes = xpath.select("//title", doc);

console.log(nodes[0].localName + ": " + nodes[0].firstChild.data);
console.log("Node: " + nodes[0].toString());

In this example, xpath.select("//title", doc) is used to select all <title> elements from the XML document.

You can also evaluate string values directly, interact with namespaces, easily map namespaces, and interact with attributes.

Where are the xpath docs?

The xpath package offers comprehensive API documentation which is hosted on GitHub. It provides in-depth information about the different methods and functions provided by the xpath package and their usage.

You can access the xpath API Documentation at this URL: https://github.com/goto100/xpath/blob/master/docs/xpath methods.md.