Liquid XML Studio
Built in XSD Types
Send Feedback
XSD Editor > Graphical Notation Overview > Built in XSD Types

Glossary Item Box

Built in Data Types

There are a number of built in data types defined within the W3C standard. The following table (taken from the standard) shows them, and provides an example value. Form more information see the standards documentation.

 

Simple Type Examples (delimited by commas) Notes
anyURI http://www.example.com/  
anyAtomicType   New in XSD 1.1, a generic type that encompasses all atomic types, both primitive and derived
anySimpleType   New in XSD 1.1 , a base type from which all other built-in types are derived. Any value (including an empty value) is allowed for xsd:anySimpleType.
base64Binary GpM7  
boolean true, false, 1, 0  
byte -128, ...-1, 0, 1, ... 127 see (2)
date 31/05/1999 see (2)
dateTime 1999-05-31T13:20:00.000-05:00 May 31st 1999 at 1.20pm Eastern Standard Time which is 5 hours behind Coordinated Universal Time, see (2)
dateTimeStamp 2004-04-12T13:20:00-05:00 New in XSD 1.1 
dayTimeDuration P3DT10H30M12.3S New in XSD 1.1 
decimal -1.23, 0, 123.4, 1000.00 see (2)
double -INF, -1E4, -0, 0, 12.78E-2, 12, INF, NaN equivalent to double-precision 64-bit floating point, see (2)
duration P1Y2M3DT10H30M12.3S 1 year, 2 months, 3 days, 10 hours, 30 minutes, and 12.3 seconds
ENTITIES   XML 1.0 ENTITIES attribute type, see (1)
ENTITY   XML 1.0 ENTITY attribute type, see (1)
float -INF, -1E4, -0, 0, 12.78E-2, 12, INF, NaN equivalent to single-precision 32-bit floating point, NaN is "not a number", see (2)
gDay -31 the 31st day, see (2) (5)
gMonth 5 May, see (2) (5)
gMonthDay -26 every May 31st, see (2) (5)
gYear 1999 1999, see (2) (5)
gYearMonth 1999-02 the month of February 1999, regardless of the number of days, see (2) (5)
hexBinary 0FB7  
ID   XML 1.0 ID attribute type, see (1)
IDREF   XML 1.0 IDREF attribute type, see (1)
IDREFS   XML 1.0 IDREFS attribute type, see (1)
int -2147483648, ... -1, 0, 1, ... 2147483647 see (2)
integer ...-1, 0, 1, ... see (2)
language en-GB, en-US, fr valid values for xml:lang as defined in XML 1.0
long -9223372036854775808, ... -1, 0, 1, ... 9223372036854775807 see (2)
Name shipTo XML 1.0 Name type
NCName USAddress XML Namespace NCName, i.e. a QName without the prefix and colon
negativeInteger ... -2, -1 see (2)
NMTOKEN US, XML 1.0 NMTOKEN attribute type, see (1)
NMTOKENS US UK, XML 1.0 NMTOKENS attribute type, i.e. a whitespace separated list of NMTOKEN's, see (1)
nonNegativeInteger 0, 1, 2, ... see (2)
nonPositiveInteger ... -2, -1, 0 see (2)
normalizedString Confirm this is electric see (3)
NOTATION   XML 1.0 NOTATION attribute type, see (1)
positiveInteger 1, 2, ... see (2)
precisionDecimal   New in XSD 1.1, the precisionDecimal data type represents decimal numbers which retain precision
QName po:USAddress XML Namespace QName
short -32768, ... -1, 0, 1, ... 32767 see (2)
Confirm this is electric  
time 13:20:00.000, 13:20:00.000-05:00 see (2)
token Confirm this is electric see (4)
unsignedByte 0, 1, ... 255 see (2)
unsignedInt 0, 1, ...4294967295 see (2)
unsignedLong 0, 1, ... 18446744073709551615 see (2)
unsignedShort 0, 1, ... 65535 see (2)
yearMonthDuration P0Y20M New in XSD 1.1 


Notes:

  1. To retain compatibility between XML Schema and XML 1.0 DTDs, the simple types ID, IDREF, IDREFS, ENTITY, ENTITIES, NOTATION, NMTOKEN, NMTOKENS should only be used in attributes. 
  2. A value of this type can be represented by more than one lexical format, e.g. 100 and 1.0E2 are both valid float formats representing "one hundred". However, rules have been established for this type that define a canonical lexical format, see XML Schema Part 2
  3. Newline, tab and carriage-return characters in a normalizedString type are converted to space characters before schema processing.
  4. As normalizedString, and adjacent space characters are collapsed to a single space character, and leading and trailing spaces are removed.
  5. The "g" prefix signals time periods in the Gregorian calendar.