fontoxpath
Advanced tools
Comparing version 3.12.1 to 3.13.0
@@ -583,2 +583,3 @@ | ||
debug?: boolean; | ||
defaultFunctionNamespaceURI?: string; | ||
disableCache?: boolean; | ||
@@ -585,0 +586,0 @@ documentWriter?: IDocumentWriter; |
{ | ||
"name": "fontoxpath", | ||
"version": "3.12.1", | ||
"version": "3.13.0", | ||
"description": "A minimalistic XPath 3.1 engine in JavaScript", | ||
"main": "dist/fontoxpath.js", | ||
"module": "dist/fontoxpath.esm.js", | ||
"directories": { | ||
@@ -24,3 +25,3 @@ "test": "test" | ||
"qt3testsxqueryx": "ts-mocha --paths -p test/tsconfig.json test/qt3testsXQueryX.ts", | ||
"test": "ts-mocha --require test/testhook.js \"test/specs/**/*.ts\" --extension ts", | ||
"test": "ts-mocha --require test/testhook.js \"test/specs/**/*.ts\" --project test/tsconfig.json", | ||
"xqutstests": "ts-mocha --paths -p test/tsconfig.json test/xqutsTests.ts", | ||
@@ -27,0 +28,0 @@ "xqutstestsxqueryx": "ts-mocha --paths -p test/tsconfig.json test/xqutsTestsXQueryX.ts", |
@@ -80,2 +80,3 @@ # fontoxpath [](https://travis-ci.org/FontoXML/fontoxpath) [](https://david-dm.org/FontoXML/fontoxpath#info=devDependencies) [](http://badge.fury.io/js/fontoxpath) [](https://packagephobia.now.sh/result?p=fontoxpath) [](https://coveralls.io/github/FontoXML/fontoxpath?branch=master) [](https://snyk.io/test/github/FontoXML/fontoxpath?targetFile=package.json) | ||
string of the original message. | ||
* `defaultFunctionNamespaceURI` `<string>` To modify or change the default function namespaceURI. Defaults to `http://www.w3.org/2005/xpath-functions`. Defining the default function namespaceURI in the xpath expression overwrites this option. | ||
@@ -89,4 +90,6 @@ ### Example | ||
evaluateXPathToString, | ||
evaluateXPathToFirstNode | ||
evaluateXPathToFirstNode, | ||
evaluateXPathToNumber, | ||
} = require('fontoxpath'); | ||
const documentNode = new DOMParser().parseFromString('<xml/>', 'text/xml'); | ||
@@ -103,2 +106,6 @@ | ||
// Outputs: "<foo>bar</foo>" | ||
// We pass the Math namespaceURI for the pi() function to be used | ||
console.log(evaluateXPathToNumber('pi()', documentNode, undefined, {}, { language: evaluateXPath.XQUERY_3_1_LANGUAGE, defaultFunctionNamespaceURI: 'http://www.w3.org/2005/xpath-functions/math'})); | ||
// Outputs: Math.PI (3.14...) | ||
``` | ||
@@ -105,0 +112,0 @@ |
Sorry, the diff of this file is too big to display
312
397545
2180