How to use the fontoxpath.evaluateXPathToString 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 / axes / AttributeAxis.tests.ts View on Github external
it('returns no attributes for comments', () =>
		chai.assert.equal(
			evaluateXPathToString(
				'attribute::someAttribute',
				documentNode.createComment('some comment')
			),
			''
		));
github FontoXML / fontoxpath / test / specs / parsing / functions / functions.tests.ts View on Github external
it('Returns a sequence containing the items in $arg in reverse order.', () =>
			chai.assert.equal(
				evaluateXPathToString('reverse(("1","2","3")) => string-join(",")', documentNode),
				'3,2,1'
			));
	});
github FontoXML / fontoxpath / test / specs / parsing / functions / functions.string.tests.ts View on Github external
it('If $arg is an atomic value, the function returns the result of the expression $arg cast as xs:string (see 19 Casting).', () => {
			chai.assert.equal(evaluateXPathToString('string(12)', documentNode), '12');
			chai.assert.equal(evaluateXPathToString('string("13")', documentNode), '13');
			chai.assert.equal(evaluateXPathToString('string(true())', documentNode), 'true');
			chai.assert.equal(evaluateXPathToString('string(false())', documentNode), 'false');
		});
github FontoXML / fontoxpath / test / specs / parsing / functions / functions.string.tests.ts View on Github external
it('If the value of $arg1 is the empty sequence, the zero length string is returned', () =>
			chai.assert.equal(evaluateXPathToString('lower-case(())', documentNode), ''));
github FontoXML / fontoxpath / test / specs / parsing / registerCustomXPathFunction.tests.ts View on Github external
it('the registered function can be used in a xPath selector with return value gDay', () => {
		chai.assert.equal(
			evaluateXPathToString('test:custom-gDay-function()', documentNode),
			'---22Z'
		);
	});
github FontoXML / fontoxpath / test / specs / parsing / functions / functions.node.tests.ts View on Github external
it('it returns the node name of the given context', () => {
			jsonMlMapper.parse(['someElement', 'Some text.'], documentNode);
			chai.assert.equal(
				evaluateXPathToString('node-name(.)', documentNode.firstChild),
				'someElement'
			);
		});
github FontoXML / fontoxpath / test / specs / parsing / functions / FunctionCall.tests.js View on Github external
	() => chai.assert.equal(evaluateXPathToString('let $fn := concat#3 return $fn("abc", "def", "ghi")', documentNode), 'abcdefghi'));
github FontoXML / fontoxpath / test / specs / parsing / functions / builtinFunctions.datetime.tests.js View on Github external
			() => chai.assert.equal(evaluateXPathToString('timezone-from-dateTime(xs:dateTime("2000-10-11T12:13:10.1+05:00")) => string()', documentNode), 'PT5H'));
	});
github FontoXML / fontoxpath / test / qt3tests.ts View on Github external
		.filter(testSetNode => shouldRunTestByName[evaluateXPathToString('@name', testSetNode)])
		.map(testSetNode => evaluateXPathToString('@file', testSetNode))
github FontoXML / fontoxpath / test / qt3tests.ts View on Github external
(varsByName, variable) =>
			Object.assign(varsByName, {
				[evaluateXPathToString('@role', variable).substr(1)]: getFile(
					(cwd ? cwd + '/' : '') + evaluateXPathToString('@file', variable)
				)
			}),
		{}