How to use the fontoxpath/expressions/dataTypes/createAtomicValue 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 / expressions / dataTypes / castToType.tests.ts View on Github external
it('from xs:dateTime', () =>
			chai.assert.deepEqual(
				castToType(
					createAtomicValue(
						DateTime.fromString('2000-10-10T10:10:10+10:30'),
						'xs:dateTime'
					),
					'xs:gYear'
				),
				createAtomicValue(DateTime.fromString('2000+10:30'), 'xs:gYear')
			));
		it('from xs:time (throws XPTY0004)', () =>
github FontoXML / fontoxpath / test / specs / expressions / dataTypes / castToType.tests.ts View on Github external
it('from xs:dayTimeDuration', () =>
			chai.assert.deepEqual(
				castToType(
					createAtomicValue(Duration.fromString('P10DT10H10M10S'), 'xs:dayTimeDuration'),
					'xs:untypedAtomic'
				),
				createAtomicValue('P10DT10H10M10S', 'xs:untypedAtomic')
			));
		it('from xs:dateTime', () =>
github FontoXML / fontoxpath / test / specs / expressions / dataTypes / castToType.tests.ts View on Github external
it('from xs:string', () =>
			chai.assert.deepEqual(
				castToType(
					createAtomicValue('2000-10-10T10:10:10+10:30', 'xs:string'),
					'xs:dateTime'
				),
				createAtomicValue(DateTime.fromString('2000-10-10T10:10:10+10:30'), 'xs:dateTime')
			));
		it('from xs:float (throws XPTY0004)', () =>
github FontoXML / fontoxpath / test / specs / expressions / dataTypes / castToType.tests.ts View on Github external
it('from xs:untypedAtomic', () =>
			chai.assert.deepEqual(
				castToType(createAtomicValue('10.10', 'xs:untypedAtomic'), 'xs:double'),
				createAtomicValue(10.1, 'xs:double')
			));
		it('from xs:string', () =>
github FontoXML / fontoxpath / test / specs / expressions / dataTypes / castToType.tests.ts View on Github external
it('from xs:untypedAtomic', () =>
			chai.assert.deepEqual(
				castToType(createAtomicValue('10:10:10+10:30', 'xs:untypedAtomic'), 'xs:time'),
				createAtomicValue(DateTime.fromString('10:10:10+10:30'), 'xs:time')
			));
		it('from xs:string', () =>
github FontoXML / fontoxpath / test / specs / expressions / dataTypes / castToType.tests.ts View on Github external
it('from xs:float', () =>
			chai.assert.deepEqual(
				castToType(createAtomicValue(10.123, 'xs:float'), 'xs:string'),
				createAtomicValue('10.123', 'xs:string')
			));
		it('from xs:double', () =>
github FontoXML / fontoxpath / test / specs / expressions / dataTypes / castToType.tests.ts View on Github external
				() => castToType(createAtomicValue(10.123, 'xs:float'), 'xs:time'),
				'XPTY0004'
github FontoXML / fontoxpath / test / specs / expressions / dataTypes / castToType.tests.ts View on Github external
() =>
					castToType(
						createAtomicValue(
							DateTime.fromString('2000-10-10T10:10:10+10:30'),
							'xs:dateTime'
						),
						'xs:double'
					),
				'XPTY0004'
github FontoXML / fontoxpath / test / specs / expressions / dataTypes / castToType.tests.ts View on Github external
() =>
					castToType(
						createAtomicValue(Duration.fromString('P10Y10M'), 'xs:dayTimeDuration'),
						'xs:float'
					),
				'XPTY0004'
github FontoXML / fontoxpath / test / specs / expressions / dataTypes / castToType.tests.ts View on Github external
chai.assert.throw(() =>
				castToType(createAtomicValue('string', 'xs:string'), 'xs:anySimpleType')
			);