Data Types in XML Authority

XML Authority provides schema developers with a wide range of choices for describing data types. XML Authority provides three kinds of data types:

The XML 1.0 data types are supported by all validating XML parsers, but only provide a limited range of constraints focused on text processing. XML-Data data types can only be validated by a few parsers (e.g., Microsoft's Internet Explorer 5 parser) when used in XML-Data schemas, but applications can use them to build their own constraints checking routines. Schema-defined notation data types must be enforced by applications - parsers will ignore them.

Data Types in XML 1.0

The XML 1.0 data types are used primarily to identify attribute types for use in document contexts. All validating XML 1.0 parsers will check these constraints to make sure that attribute values fit these rules. None of these data types is really oriented toward data in the sense used by programmers and database developers, but can be useful for describing relationships within documents and for constraining data to a list of acceptable values.

Identifier

Meaning and Constraints

ID

The value must be an XML name, beginning with a letter and otherwise composed of letters, digits, hyphens, underscores, and full stop characters. (Colons are prohibited for documents conforming to the Namespaces in XML 1.0 W3C Recommendation.) The value of the attribute must also be unique within the document among all attributes of type ID. ID attributes may never have fixed default values. Only one attribute per element may be of type ID. Typically, attributes containing ID values are named 'id', though this is not required.

IDREF

The attribute value must match the value of an ID attribute of an element contained within the same XML document.

IDREFS

Multiple values of ID attributes may appear, separated by white space, but all must match ID values in the document. (A single ID value is also acceptable.)

ENTITY

The attribute value must match the name of an external unparsed entity declared elsewhere in the document type definition. (Colons are prohibited within the value of this type of attribute for documents conforming to the Namespaces recommendation.)

ENTITIES

Like ENTITY, except that multiple names of unparsed entities may appear with white space separating the values. (Colons are prohibited within the value of this type of attribute for documents conforming to the Namespaces recommendation.)

NMTOKEN

The attribute value must contain letters, digits, periods, dashes, underscores, combining characters or extenders. No other characters (including white space) may appear. (Colons are prohibited within the value of this type of attribute for documents conforming to the Namespaces recommendation.)

NMTOKENS

Like NMTOKEN, except that multiple name values may appear with white space separating the values. (Colons are prohibited within the value of this type of attribute for documents conforming to the Namespaces recommendation.)

enumerated

Provides a list of acceptable values. The word enumerated isn't stated in the declaration. Instead, a list of possible values for the attribute appear in the Constraints area in parentheses, separated by vertical ('or') bars. (value | value ...).

NOTATION

The NOTATION keyword must be followed by a list of acceptable notation identifiers in the same format - (value | value ...) - used for enumerated values. All values provided must have been declared as NOTATIONS elsewhere in the document type definition.

Data-oriented Types

Each schema dialect supports a slightly different set of data types. Each of the data-oriented types available within XML Authority is listed below along with a brief description of its constraints and schema support .  Note that within XML Authority, DTD data typing options include data types based on the XML-Data proposal submitted to the W3C.  Since the DTD syntax does not directly support these data types, XML Authority uses a convention, drawn from international standards for SGML, to encode this information within the DTD. For a more detailed discussion, please see Processing Data Types.

Data Type

Constraints Imposed

Schema Support

string

Content is a text string.

ALL

number

Content is a number of some kind.

DTD,  XDR,  SOX

integer

Content is an integer number.

DTD,  XDR, XSDL
int Content is an integer in the range -2,147,483,648 to 2,147,483,647 SOX

currency

Content represents a currency value.

DTD, XDR
decimal Content represents decimal numbers with arbitrary precision. DTD, XDR, XSDL

float

Content is a floating-point number.

ALL
double Content is a double precision floating point number in the range -1.17549435 * 10E308 to 1.17549435 * 10E308. SOX, XSDL

boolean

Content is a boolean (true or false).

ALL

dateTime

Content is a date and time.

DTD, XDR, SOX

date

Content is a date.

ALL

time

Content is a time.

ALL
datetime.tz Content is a date and time plus time zone information. DTD, XDR
time.tz Content is a time plus time zone information. DTD, XDR
timeInstant Content is a combination of date and time values. XSDL
long Content is an integer in the range -9223372036854775808 to  9223372036854775807. SOX
binary
Content represents arbitrary binary data. Binary cannot be used directly in a schema. Only data types that are derived from binary via the encoding constraint can be used in a schema.
XSDL
byte An integer in the range -128 to 127. SOX
character Content is 1 Unicode character (16 bits) string. DTD, XDR
uri Content is a sequence of characters forming a valid URI. ALL
interval   DTD, XDR
1-byte integer Content is an integer represented by a single byte. DTD, XDR
2-byte integer Content is an integer represented by two bytes. DTD, XDR
4-byte integer Content is an integer represented by four bytes. DTD, XDR
8-byte integer Content is an integer represented by eight bytes. DTD, XDR
1-byte unsigned integer Content is an unsigned integer represented by a single byte. DTD, XDR
2-byte unsigned integer Content is an unsigned integer represented by two bytes. DTD, XDR
4-byte unsigned integer Content is an unsigned integer represented by four bytes. DTD, XDR
8-byte unsigned integer Content is an unsigned integer represented by eight bytes. DTD, XDR
4-byte float Content is a floating-point number represented by four bytes. DTD, XDR
8-byte float Content is a floating-point number represented by four bytes. DTD, XDR
UUID Content is hexidecimal digits representing octets. DTD, XDR
bin hex Content is BinHex-encoded, representing binary information with a text transformation. (Commonly used in Apple Macintosh projects.) DTD, XDR
base64 Content is base64-encoded, representing binary information with a text transformation. (Commonly used in MIME-based projects.) DTD, XDR

Creating Data Types with Notations

XML Authority also allows schema developers to create their own data types using notations. Notations created in the Notations window will be available for use in both element and attribute declarations as data types.

Copyright 2000 Extensibility, Inc.

Suite 250, 200 Franklin Street, Chapel Hill, North Carolina 27516