4 Datatypes

4.1 XML Schema 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 (the Basic module contains only those datatypes with an asterisk*):

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
integer *
nonPositiveInteger *
negativeInteger *
long *
int *
short *
byte *
nonNegativeInteger *
unsignedLong *
unsignedInt *
unsignedShort *
unsignedByte *
positiveInteger *

Issue (datatype-identifiers):

One requirement is for XForms to include unique identifiers for each datatype listed here. We believe the facilities in XML Schema are sufficient for this, but welcome feedback on this issue.

Issue (now-facet):

Previous Working Drafts of XForms specified "dynamic facets" that could be reevaluated at arbitrary times. One benefit of that approach was that a now() expression could be used as a constraining facet on date/time datatypes. What are our options for including similar functionality within the framework of XML Schema datatypes?

4.2 XForms Datatypes

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

4.2.1 tokenList

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. This datatype is suitable for XForms Basic or XForms Full.

  • Examples: The string "United States of America" represents a list of four tokens:

    "America", "of", States", and "United"

Note:

In most cases, it is advised to use markup to distinguish items in a list. See 9.4 Dynamic Selection Choices.