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

csstoxpath

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

csstoxpath

CSS to XPath

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
83K
increased by17.47%
Maintainers
1
Weekly downloads
 
Created
Source

Build Status

CSS to XPath

Converts most CSS 2.1/3 selectors (see exclusions below) to equivalent XPath.

See test.js for examples.

Custom pseudo classes

All :text* text matching pseudo classes normalize whitespace and ignore tags. E.g. " my <i>string</i> " is treated as "my string".

  • :text("foo") Case-insensitive matching of element text content
  • :text-case("foo") As :text but case-sensitive
  • :text-contains("foo") Case-insensitive substring matching of element text content
  • :text-contains-case("foo") As :text-contains but case-sensitive
  • :childless As :empty but ignoring whitespace

Unsupported selectors

These may be supported at a later date:

  • nth-last-child
  • :lang()

As far as I'm aware the following cannot be implemented in XPath:

  • *-of-type

The following are excluded as they can only be partially supported (XPath only matches static attributes):

  • :checked
  • :disabled
  • :enabled
  • :required

Keywords

FAQs

Package last updated on 30 Nov 2017

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