update dependency after merge from master

This commit is contained in:
Slawomir Jaranowski
2020-09-05 13:15:58 +02:00
parent c61c04a8ed
commit 3c08118ca6
17 changed files with 5814 additions and 5723 deletions

View File

@ -2,15 +2,15 @@
The `xpath.parse()` method returns an `XPathEvaluator`, which contains the following methods.
Each of these methods takes an optional `options` object, which can contain any of the following properties:
Each of these methods takes an optional `options` object, which can contain any of the following properties. See the links for each item for further details:
`namespaces` - a namespace resolver. See the [documentation page](namespace%20resolvers.md) for details.
- `namespaces` - a [namespace resolver](namespace%20resolvers.md)
`variables` - a variable resolver. See the [documentation page](variable%20resolvers.md) for details.
- `variables` - a [variable resolver](variable%20resolvers.md)
`functions` - a function resolver. See the [documentation page](function%20resolvers.md) for details.
- `functions` - a [function resolver](function%20resolvers.md)
`node` - the context node for evaluating the expression
- `node` - the context node for evaluating the expression
Example usage:
@ -56,7 +56,7 @@ This is only valid for expressions that evaluate to a node set.
`select1([options])`
Evaluates the XPath expression and the first node in the resulting node set, in document order. Returns `undefined`
Evaluates the XPath expression and the first node in the resulting node set, in document order. Returns `undefined` if the resulting node set is empty.
This is only valid for expressions that evaluate to a node set.

View File

@ -31,11 +31,11 @@ Example usage:
```js
var evaluator = xpath.parse('squareRoot(10)');
var aboutPi = evaluator.evaluateNumber({
functions: {
'squareRoot': function (c, value) {
return Math.sqrt(value.numberValue());
}
}
functions: {
'squareRoot': function (c, value) {
return Math.sqrt(value.numberValue());
}
}
});
```
@ -49,13 +49,13 @@ Example usage:
```js
var evaluator = xpath.parse('math:squareRoot(10)');
var aboutPi = evaluator.evaluateNumber({
functions: function (name, namespace) {
functions: function (name, namespace) {
if (name === 'squareRoot' && namespace === 'http://sample.org/math/') {
return function (c, value) {
return Math.sqrt(value.numberValue());
};
return function (c, value) {
return Math.sqrt(value.numberValue());
};
}
},
},
namespaces: {
math: 'http://sample.org/math/'
}
@ -72,14 +72,14 @@ Example usage:
```js
var evaluator = xpath.parse('math:squareRoot(10)');
var aboutPi = evaluator.evaluateNumber({
functions: {
functions: {
getFunction: function (name, namespace) {
if (name === 'squareRoot' && namespace === 'http://sample.org/math/') {
return function (c, value) {
return Math.sqrt(value.numberValue());
};
return function (c, value) {
return Math.sqrt(value.numberValue());
};
}
}
}
},
namespaces: {
math: 'http://sample.org/math/'