How to use the fontoxpath/expressions/dataTypes/castToType 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:gMonthDay', () =>
			chai.assert.deepEqual(
				castToType(
					createAtomicValue(DateTime.fromString('--10-10+10:30'), 'xs:gMonthDay'),
					'xs:gMonthDay'
				),
				createAtomicValue(DateTime.fromString('--10-10+10:30'), 'xs:gMonthDay')
			));
		it('from xs:gDay (throws XPTY0004)', () =>
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:date'
				),
				createAtomicValue(DateTime.fromString('2000-10-10+10:30'), 'xs:date')
			));
		it('from xs:time (throws XPTY0004)', () =>
github FontoXML / fontoxpath / test / specs / expressions / dataTypes / castToType.tests.ts View on Github external
it('from xs:string', () =>
			chai.assert.deepEqual(
				castToType(
					createAtomicValue('736F6D65206261736536342074657874', 'xs:string'),
					'xs:hexBinary'
				),
				createAtomicValue('736F6D65206261736536342074657874', 'xs:hexBinary')
			));
		it('from xs:float (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(DayTimeDuration.fromString('P10D'), 'xs:dayTimeDuration'),
					'xs:duration'
				),
				createAtomicValue(Duration.fromString('P10D'), 'xs:duration')
			));
		it('from xs:dateTime (throws XPTY0004)', () =>
github FontoXML / fontoxpath / test / specs / expressions / dataTypes / castToType.tests.ts View on Github external
it('from xs:gYear', () =>
			chai.assert.deepEqual(
				castToType(
					createAtomicValue(DateTime.fromString('2000+10:30'), 'xs:gYear'),
					'xs:gYear'
				),
				createAtomicValue(DateTime.fromString('2000+10:30'), 'xs:gYear')
			));
		it('from xs:gMonthDay (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:float'),
				createAtomicValue(10.1, 'xs:float')
			));
		it('from xs:string', () =>
github FontoXML / fontoxpath / test / specs / expressions / dataTypes / castToType.tests.ts View on Github external
() =>
					castToType(
						createAtomicValue(DateTime.fromString('---10+10:30'), 'xs:gDay'),
						'xs:boolean'
					),
				'XPTY0004'
github FontoXML / fontoxpath / test / specs / expressions / dataTypes / castToType.tests.ts View on Github external
() =>
					castToType(
						createAtomicValue('21FE3A44123C21FE3A44123C', 'xs:hexBinary'),
						'xs:time'
					),
				'XPTY0004'
github FontoXML / fontoxpath / test / specs / expressions / dataTypes / castToType.tests.ts View on Github external
				() => castToType(createAtomicValue('string', 'xs:untypedAtomic'), 'xs:NOTATION'),
				'XPST0080'
github FontoXML / fontoxpath / test / specs / expressions / dataTypes / castToType.tests.ts View on Github external
() =>
					castToType(
						createAtomicValue(DateTime.fromString('2000-10+10:30'), 'xs:gYearMonth'),
						'xs:gDay'
					),
				'XPTY0004'