Skip to content

XSSimpleType

do- edited this page Dec 19, 2024 · 41 revisions

XSSimpleType is a class which instances represent XML Schema's simple type definitions.

Some of them are predefined, they correspond to built in datatypes. Others are constructed while loading XMLSchemata.

Its main method, stringify (value), maps an arbitrary javaScript value into the corresponding string from the type's lexical-space, or throws an error unless such conversion is possible.

While XSSimpleType itself is abstract, its ancestors are heavily used by XMLMarshaller.stringify (). Hereafter, those derived classes are described with their specific stringify rules.

Subclass XML Types Acceptable Values Notes
XSSimpleTypeBoolean boolean true, false, 'true', 'false', 1, 0, '1', '0'
XSSimpleTypeDecimal decimal ! isNaN() Honors the fractionDigits restriction
XSSimpleTypeInteger integer Number.isInteger()
XSSimpleTypeFloat double, float ! isNaN()
XSSimpleTypeQName QName {localName, namespaceURI}

Clone this wiki locally