How to use the fontoxpath.evaluateXPathToNumbers function in fontoxpath

To help you get started, we’ve selected a few fontoxpath 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 FontoXML / fontoxpath / test / specs / parsing / functions / functions.numeric.tests.js View on Github external
			() => chai.assert.deepEqual(evaluateXPathToNumbers('round(())', documentNode), []));
		it('returns NaN when given NaN',
github FontoXML / fontoxpath / test / specs / parsing / predicates / predicates.tests.ts View on Github external
it('works with boolean values: all', () =>
		chai.assert.deepEqual(evaluateXPathToNumbers('(1,2,3)[true()]', documentNode), [1, 2, 3]));
	it('works with boolean values: none', () =>
github FontoXML / fontoxpath / test / specs / parsing / operators / sequenceOperator.tests.ts View on Github external
it('creates an empty sequence when passed () to 10', () =>
		chai.assert.deepEqual(evaluateXPathToNumbers('() to 10'), []));
github FontoXML / fontoxpath / test / specs / parsing / functions / FunctionCall.tests.ts View on Github external
it('atomizes attributes to anyUntypedAtomic, then transforming it to a numerical value', () => {
		jsonMlMapper.parse(
			[
				'someElement',
				{
					attr: '1'
				}
			],
			documentNode
		);
		chai.assert.deepEqual(evaluateXPathToNumbers('@attr to 2', documentNode.firstChild), [
			1,
			2
		]);
	});
github FontoXML / fontoxpath / test / specs / parsing / forExpression.tests.ts View on Github external
it('supports positionalVariableBindings', () => {
		chai.assert.deepEqual(
			evaluateXPathToNumbers('for $item at $index in (4,5,6) return ($item, $index)'),
			[4, 1, 5, 2, 6, 3]
		);
	});
	it('supports variableBindings and positionalVariableBindings with namespaces', () => {
github FontoXML / fontoxpath / test / specs / parsing / postfix / Filter.tests.js View on Github external
		() => chai.assert.empty(evaluateXPathToNumbers('(1,2,3)[()]')));
	it('returns the sequence when filtering with a string',
github FontoXML / fontoxpath / test / specs / parsing / functions / functions.numeric.tests.ts View on Github external
it('returns an empty sequence when given an empty sequence', () =>
			chai.assert.deepEqual(
				evaluateXPathToNumbers('round-half-to-even(())', documentNode),
				[]
			));
		it('returns NaN when given NaN', () =>
github FontoXML / fontoxpath / test / specs / parsing / operators / sequenceOperator.tests.ts View on Github external
it('creates a sequence', () =>
		chai.assert.deepEqual(evaluateXPathToNumbers('1 to 10'), [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]));
github FontoXML / fontoxpath / test / specs / parsing / functions / FunctionCall.tests.ts View on Github external
			() => evaluateXPathToNumbers('@attr to 2', documentNode.firstChild),
			'FORG0001'
github FontoXML / fontoxpath / test / specs / parsing / functions / FunctionCall.tests.js View on Github external
		chai.assert.throws(() => evaluateXPathToNumbers('@attr to 2', documentNode.firstChild), 'FORG0001');
	});