evaluate XPath To Number
Type: Function
How to get evaluateXPathToNumber?
JavaScript
import evaluateXPathToNumber from 'fontoxml-selectors/src/evaluateXPathToNumber.js'
Evaluate any XQuery script to the only number of the result, casting the returned value if need-be. You can also use functions defined in XQuery modules. Refer to the concept page of XQuery for details. While XQuery update facility is allowed, mutating existing nodes is not allowed. Use the execute-update-script operation to mutate the document using XQUF.
Arguments
xquery
(Required)
Type: XPathQuery
The XPath to evaluate
context
Node (Required)
Type: Node | NULL
The initial context of the query. If context is absent, it is still possible to evaluate some queries, like '1+1', or queries using only variables.
dom
Facade (Required)
Type: Blueprint
The blueprint (or blueprint compatible interface) to use for this query.
variables
(Required)
Type: Object<String, any>
Any variables to use for this query. They will be prefixed with a '$' sign See https://github.com/FontoXML/fontoxpath for more info on this parameter.
Default value
options
(Required)
Type: Object<String, any>
See https://github.com/FontoXML/fontoxpath for more info on this parameter.
Properties
Default value
Returns
Type: Number
The result of the query.