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

openrosa-xpath-evaluator

Package Overview
Dependencies
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

openrosa-xpath-evaluator

Wrapper for browsers' XPath evaluator with added support for OpenRosa extensions.

  • 1.2.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
602
increased by16.44%
Maintainers
1
Weekly downloads
 
Created
Source

Openrosa XForms Evaluator

Wrapper for browsers' XPath evaluator with added support for OpenRosa extensions.

For more info on extended XPath expressions/bindings supported by XForms/OpenRosa/OpenDataKit (ODK) see:

Limitations

Any expression made requesting a node-type result will be delegated to the underlying xpath evaluator.

Also, the expression parser is currently very basic and will fail for some xpath expressions. Some examples of expressions that are and are not supported follow.

Supported XPath expressions:

  • /model/instance[1]//*
  • /model/instance[1]/*/meta/*
  • ./author
  • author
  • first.name
  • /bookstore
  • //author
  • author/first-name
  • bookstore//title
  • bookstore/*/title
  • bookstore//book/excerpt//emph
  • .//title
  • author/*
  • book/*/last-name
  • @style
  • price/@exchange
  • price/@exchange/total
  • book[@style]
  • book/@style
  • ./first-name
  • first-name
  • author[1]
  • author[first-name][3]
  • my:book
  • x/y[1]
  • x[1]/y[2]
  • book[excerpt]
  • book[excerpt]/title
  • book[excerpt]/author[degree]
  • book[author/degree]
  • author[degree][award]
  • ancestor::book[1]
  • ancestor::book[author][1]
  • ancestor::author[parent::book][1]

Unsupported XPath expressions:

  • */*
  • *[@specialty]
  • @my:*
  • @*
  • author[degree and award]
  • author[(degree or award) and publication]
  • author[degree and not(publication)]
  • author[not(degree or award) and publication]
  • author[. = "Matthew Bob"]
  • author[last-name = "Bob" and ../price > 50]
  • author[not(last-name = "Bob")]
  • author[first-name = "Bob"]
  • author[last-name = "Bob" and first-name = "Joe"]
  • author[* = "Bob"]
  • author[last-name = "Bob"]
  • author[last-name[1] = "Bob"]
  • author[last-name [position()=1]= "Bob"]
  • book[last()]
  • book/author[last()]
  • book[position() <= 3]
  • book[/bookstore/@specialty=@style]
  • degree[position() < 3]
  • degree[@from != "Harvard"]
  • my:*
  • p/text()[2]
  • price[@intl = "Canada"]
  • x/y[position() = 1]
  • (book/author)[last()]
  • (x/y)[1]

FAQs

Package last updated on 14 Mar 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