How to use the openrosa-xpath-evaluator.XPathEvaluator function in openrosa-xpath-evaluator

To help you get started, we’ve selected a few openrosa-xpath-evaluator examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github enketo / enketo-core / src / js / xpath-evaluator-binding.js View on Github external
export default function( addExtensions ) {
    const evaluator = new XPathJS.XPathEvaluator();

    /*
     * Note: it's inefficient to extend XPathJS here (for every model instance)
     * instead of just once in the prototype.
     *
     * However, this is done to prevent breaking Medic Mobile.
     * The performance impact is probably negligible, since we don't instantiate
     * models very often.
     *
     * In any case, you don't have to use it like this. It was done for
     * Enketo Validate only. In an app that doesn't override enketo-xpathjs,
     * I'd recommend using `require('extension')(require('enketo-xpathjs'))` instead
     * and leave the addExtensions parameter empty here.
     */
    if ( typeof addExtensions === 'function' ) {
        addExtensions( XPathJS );

openrosa-xpath-evaluator

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

Apache-2.0
Latest version published 6 months ago

Package Health Score

42 / 100
Full package analysis