How to use the fontoxpath.evaluateXPathToStrings 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.string.tests.ts View on Github external
it('Returns an empty sequence when one of the inputs is an empty sequence', () => {
			chai.assert.deepEqual(evaluateXPathToStrings('compare("a", ())', documentNode), []);
			chai.assert.deepEqual(evaluateXPathToStrings('compare((), "a")', documentNode), []);
		});
github FontoXML / fontoxpath / test / specs / parsing / functions / builtinFunctions.sequences.tests.ts View on Github external
it('returns the original sequence when the position is out of bounds (greater than largest position)', () =>
				chai.assert.deepEqual(
					evaluateXPathToStrings('remove(("a", "b", "c"), 5)', documentNode),
					['a', 'b', 'c']
				));
			it('returns the sequence with the item at the given position removed', () =>
github FontoXML / fontoxpath / test / specs / parsing / functions / builtinFunctions.sequences.tests.ts View on Github external
it('returns the empty sequence when inputted a start higher than the length of the input', () =>
				chai.assert.deepEqual(
					evaluateXPathToStrings('subsequence(("a", "b", "c"), 4)', documentNode),
					[]
				));
			it('returns the last item if the start is length', () =>
github FontoXML / fontoxpath / test / specs / parsing / functions / builtinFunctions.sequences.tests.ts View on Github external
it('returns a sequence starting at position until the end of the given sequence', () =>
				chai.assert.deepEqual(
					evaluateXPathToStrings('subsequence(("a", "b", "c"), 2)', documentNode),
					['b', 'c']
				));
			it('returns the empty sequence when inputted a start higher than the length of the input', () =>
github FontoXML / fontoxpath / test / specs / parsing / functions / builtinFunctions.sequences.tests.ts View on Github external
it('returns an reversed sequence', () =>
				chai.assert.deepEqual(
					evaluateXPathToStrings('reverse(("a", "b", "c"))', documentNode),
					['c', 'b', 'a']
				));
		});
github FontoXML / fontoxpath / test / specs / parsing / functions / builtinFunctions.sequences.tests.ts View on Github external
it('returns the first item when start = -10 and length = 12 FIRST', () =>
				chai.assert.deepEqual(
					evaluateXPathToStrings('subsequence(("a", "b", "c"), -10, 12)', documentNode),
					['a']
				));
			it('returns the first item when start = -10 and length = 12 SECOND, for static compilation checks', () =>
github FontoXML / fontoxpath / test / specs / parsing / functions / builtinFunctions.sequences.tests.ts View on Github external
it('returns the full sequence when start = 1 and length = INF', () =>
				chai.assert.deepEqual(
					evaluateXPathToStrings(
						'subsequence(("a", "b", "c"), 0, xs:double("+INF"))',
						documentNode
					),
					['a', 'b', 'c']
				));
			it('returns the first item when start = -10 and length = 12 FIRST', () =>
github FontoXML / fontoxpath / test / specs / parsing / functions / functions.aggregate.tests.js View on Github external
			() => chai.assert.deepEqual(evaluateXPathToStrings('max(())', documentNode), []));
		it('casts untypedAtomic to double');
github FontoXML / fontoxpath / test / specs / parsing / operators / SimpleMapOperator.tests.ts View on Github external
it('accepts a sequence as first expression: (1, 2, 3) ! string()', () =>
		chai.assert.deepEqual(evaluateXPathToStrings('(1, 2, 3) ! string()', documentNode), [
			'1',
			'2',
			'3'
		]));
github FontoXML / fontoxpath / test / specs / parsing / operators / SimpleMapOperator.tests.js View on Github external
		() => chai.assert.deepEqual(evaluateXPathToStrings('(1, 2, 3) ! string()', documentNode), ['1', '2', '3']));