Skip to main content

By clicking Submit, you agree to the developerWorks terms of use.

The first time you sign into developerWorks, a profile is created for you. Select information in your developerWorks profile is displayed to the public, but you may edit the information at any time. Your first name, last name (unless you choose to hide them), and display name will accompany the content that you post.

All information submitted is secure.

  • Close [x]

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerworks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

By clicking Submit, you agree to the developerWorks terms of use.

All information submitted is secure.

  • Close [x]

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.