5 Datatypes

This chapter defines the datatypes used in XForms, both built-in and defined for XForms.

5.1 XML Schema Built-in Datatypes

XForms includes all XML Schema datatypes, including the concepts of value space and lexical space, and all constraining facets, as specified in [XML Schema part 2]. These are further divided into two modules, called Basic and Full, and are as follows. Base types included in module basic are marked with an asterisk *. Datatypes derived by restriction and derived by list from these base types are included in both Basic and Full modules.

Built-in primitive types:

duration *
dateTime *
time *
date *
gYearMonth *
gYear *
gMonthDay *
gDay *
gMonth *
string *
boolean *
base64Binary *
hexBinary
float
decimal *
double
anyURI *
QName
NOTATION

Built-in derived types:

normalizedString
token
language
Name
NCName
ID
IDREF
IDREFS
ENTITY
ENTITIES
NMTOKEN
NMTOKENS
integer *
nonPositiveInteger *
negativeInteger *
long *
int *
short *
byte *
nonNegativeInteger *
unsignedLong *
unsignedInt *
unsignedShort *
unsignedByte *
positiveInteger *

5.2 XForms Datatypes

The Schema for XForms derives the following types for use within forms:

5.2.1 listItem

This datatype serves as a base for the listItems datatype. The value space for listItem permits one or more characters valid for xsd:string, except whitespace characters. This datatype is suitable for XForms Basic or XForms Full.

Examples:

x
vanilla
grün

5.2.2 listItems

XForms includes form controls that produce simpleType list content. To prevent the need of authors to continuously redefine a derived-by-list datatype suitable for this case, one is included here. The value space for listItems is defined by list-derivation from listItem. This datatype is suitable for XForms Basic or XForms Full.

Example:

x vanilla grün

Note:

In most cases, it is better to use markup to distinguish items in a list. See 8.11.3 itemset.