Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

wicked-good-xpath

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wicked-good-xpath

Pure JS implementation of the DOM Level 3 XPath specification

  • 1.3.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created

What is wicked-good-xpath?

The wicked-good-xpath npm package is a JavaScript library that provides an implementation of XPath 1.0 for use in web browsers and Node.js. It allows you to query and manipulate XML documents using XPath expressions.

What are wicked-good-xpath's main functionalities?

Evaluate XPath Expressions

This feature allows you to evaluate XPath expressions against an XML document. The code sample demonstrates how to install the XPath evaluator, parse an XML string, and evaluate an XPath expression to retrieve a specific element.

const wgxpath = require('wicked-good-xpath');
const { DOMParser } = require('xmldom');

// Install wgxpath
wgxpath.install();

// Sample XML
const xml = '<root><element id="1">Value</element></root>';
const doc = new DOMParser().parseFromString(xml, 'text/xml');

// Evaluate XPath expression
const result = doc.evaluate('//element[@id="1"]', doc, null, wgxpath.XPathResultType.ANY_TYPE, null);
const node = result.iterateNext();
console.log(node.textContent); // Output: Value

Install XPath in the Global Scope

This feature allows you to install the XPath evaluator globally, making it available throughout your application without needing to import it in every module.

const wgxpath = require('wicked-good-xpath');

// Install wgxpath globally
wgxpath.install();

// Now you can use XPath expressions globally in your application

Other packages similar to wicked-good-xpath

Keywords

FAQs

Package last updated on 01 Apr 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc