The basics of using XML Schema to define elements

Get started using XML Schema instead of DTDs for defining the structure of XML documents

Return to article.

Table 2: Predefined simple types for values
Simple typeExample or explanation
string "this is a string"
boolean true, false
floatsingle-precision floating point
doubledouble precision 64-bit floating point
decimal 123.45
integer -12345; 0; 12345
non-positive-integer -12345; 0
negative-integer -12345
long 1234567890123
int 123456789
short 12345
byte 123
non-negative-integer 0; 123456
unsigned-long 123456789012345
unsigned-int 1234567801
unsigned-short 12345
unsigned-byte 123
positive-integer 123456
date 2000-02-16
time 15:55:00.000
timeInstant 2000-12-31T05:55:00.000  (5:55 am, Coordinated Universal Time)
timeDuration P5Y1M4D10H20M1.2S (5 years; 1 month;
4 days; 20 minutes; 1.2 seconds)
recurringInstant --02-16T5:55:00 (February 16th every year at 5:55 am.
Coordinated Universal Time)
binarybit pattern
uri-referencestandard URL
ID*XML 1.0 Compatibility
IDREF*XML 1.0 Compatibility
ENTITY*XML 1.0 Compatibility
NOTATION*XML 1.0 Compatibility
languageen-US (see xml:lang in XML 1.0)
IDREFS*XML 1.0 Compatibility
ENTITIES*XML 1.0 Compatibility
NMTOKEN*XML 1.0 Compatibility
NMTOKENS*XML 1.0 Compatibility
Name  see XML 1.0
QName (Prefix ':')? NCName = LocalPart (e.g.; po:Address)
NCName (letter | '_') (NCNameChar)*

*Use only in attributes to ensure compatibility with XML 1.0 DTD.

Return to article.