0% found this document useful (0 votes)
49 views2 pages

XML Schema - Data Types Q U Ick Reference

This document provides a reference of XML Schema data types including logic, binary, text, number, date/time types. It defines types like boolean, base64Binary, string, decimal, date, time and duration.

Uploaded by

David Perez
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
49 views2 pages

XML Schema - Data Types Q U Ick Reference

This document provides a reference of XML Schema data types including logic, binary, text, number, date/time types. It defines types like boolean, base64Binary, string, decimal, date, time and duration.

Uploaded by

David Perez
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

integer Integer or whole numbers - Sign omitted, "+" is assumed.

Example: -1, 0, 7 XML Types


12678967543233, +100000.
Name XML Names
long 9223372036854775807 to -9223372036854775808. Sign omitted, "+"
assumed.
NCName XML "non-colonized" Names.

XML Schema - Data Types Example: -1, 0, 12678967543233, +100000.

negativeInteger Infinite set {...,-2,-1}.


NOTATION
QName
NOTATION type

XML qualified names


Quick Reference Example: -1, -12678967543233, -100000.

nonNegativeInteger Infinite set {0, 1, 2, ...}. Sign omitted, "+" assumed, leading
Following attribute types should only be used in attribute
declaration for compatiblity reasons:

ver 9/01 zeroes are prohibited. ENTITIES ENTITIES attribute type


Example: 1, 0, 12678967543233, +100000.
© 2001 D VInt Productions
ENTITY ENTITY attribute type
http://www.xml.dvint.com nonPositiveInteger Infinite set {...,-2,-1,0}. Example: -1, 0, -126733, -100000.
ID ID attribute type
positiveInteger Infinite set {1, 2, ...}. Optional "+" sign, leading zeroes are pro-
hibited. Example: 1, 12678967543233, +100000. IDREF IDREF attribute type
1 Namespaces
• http://www.w3.org/2001/XMLSchema short 32767 to -32768. Sign omitted, "+" assumed. IDREFS IDREFS attribute type
• http://www.w3.org/2001/XMLSchema-datatypes Example: -1, 0, 12678, +10000. NMTOKEN NMTOKEN attribute type
2 Logic Types unsignedByte 0 to 255. a finite-length leading zeroes prohibited. NMTOKENS NMTOKENS attribute type
Example: 0, 126, 100.
boolean binary-valued logic legal literals {true, false, 1, 0}
8 S im p l e D a t a T y p e D e c l a r a t i o n
unsignedInt 0 to 4294967295 leading zeroes are prohibited. Example: 0,
3 B inary Data Types 1267896754, 100000. <simpleType id = ID
base64Binary Base64-encoded arbitrary binary data. unsignedLong 0 to 18446744073709551615. final = (#all | (list | union | restriction))
Example: 0, 12678967543233, 100000. name = NCName>
hexBinary Arbitrary hex-encoded binary data. Example, "0FB7" is a hex encoding
for 16-bit int 4023 (binary 111110110111). Content: ( annotation ?, ( restriction | list | union )) </simpleType>
unsignedShort 0 to 65535 leading zeroes are prohibited.
Example: 0, 12678, 10000. <restriction id = ID
4 Text types
base = QName>
6 Date Time Types
anyURI A Uniform Resource Identifier Reference (URI). Can be absolute or rela- Content: ( annotation ?, ( simpleType ?, ( minExclusive | minInclusive |
tive, and may have an optional fragment identifier date Calendar date. Example, May the 31st, 1999 is: 1999-05-31. maxExclusive | maxInclusive | totalDigits | fractionDigits | length | minLength |
language natural language identifiers [RFC 1766] Example: en, fr dateTime Specific instant of time. ISO 8601 extended format CCYY-MM-
maxLength | enumeration | whiteSpace | pattern )*)) </restriction>
normalizedString White space normalized strings DDThh:mm:ss. Example, to indicate 1:20 pm on May the 31st, 1999 for Eastern <list id = ID
Standard Time which is 5 hours behind Coordinated Universal Time (UTC): 1999-05-
string Character strings in XML
itemType = QName>
31T13:20:00-05:00.
Content: ( annotation ?, ( simpleType ?)) </list>
token Tokenized strings. duration A duration of time. ISO 8601 extended format <union id = ID
PnYn MnDTnH nMn S. Example, to indicate duration of 1 year, 2 months, 3 days, 10
5 Number Types memberTypes = List of QName>
hours, and 30 minutes: P1Y2M3DT10H30M. One could also indicate a duration of
minus 120 days as: -P120D. Content: ( annotation ?, ( simpleType *)) </union>
byte 127 to-128. Sign is omitted, "+" assumed.
Example: -1, 0, 126, +100. gDay Gregorian day, a day such as the 5th of the month.
decimal Arbitrary precision decimal numbers. Sign omitted, "+" is assumed. Lead- gMonth Gregorian month. Example: May is 05.
ing and trailing zeroes are optional. If the fractional part is zero, the period and fol-
lowing zero(es) can be omitted. gMonthDay Gregorian specific day in a month.
Example: Feb 5 is 02-05.
double Double-precision 64-bit floating point type - legal literals {0, -0, INF, -INF
and NaN} Example, -1E4, 12.78e-2, 12 and INF gYear Gregorian calendar year. Example, year 1999, write: 1999.

float 32-bit floating point type - legal literals {0, -0, INF, -INF and NaN} Example, - gYearMonth Specific gregorian month and year. ©2001 D Vint Productions
1E4, 1267.43233E12, 12.78e-2, 12 and INF Example, May 1999, write: 1999-05.
xmlhelp@ dvint.com
int 2147483647 to -2147483648. an optional sign followed by a finite-length tim e An instant of time that recurs every day. Example, 1:20 pm for Eastern Stan- http://w w w .xm l.dvint.com
sequence of decimal digits (#x30-#x39). If the sign is omitted, "+" is assumed. Exam- dard Time which is 5 hours behind Coordinated Universal Time (UTC), write:
ple: -1, 0, 126789675, +100000. 13:20:00-05:00.
Constraining Facets 9 Regular Expressions for Patterns
<length id = ID <maxExclusive id = ID

fra ctio n D ig its


m ax In clu siv e
m a x E c lu s iv e
m in E xc lus iv e
e n u m e ra tio n

m in In c lu s iv e
w h ite S p a c e
fixed = boolean : false fixed = boolean : false S p e c i a l C h a r a c t e r s n e e d i n g t o b e e s c a p e d w i t h a ‘\’

m in L en g th
m a x L e ng th

to talD ig its
\|.-^?*+{}()[]
value = nonNegativeInteger > value = anySimpleType> Data Type

p a tte rn
le n g th
Content: (annotation?) </length> Content: (annotation?) Special Character Sequences
</maxExclusive> \n newline \W not XML Letter or Digit charac-
<minLength id = ID
ters
fixed = boolean : false <minExclusive id = ID decimal ? ? ? ? ? ? ? ? ?
\r return
value = nonNegativeInteger > fixed = boolean : false \t tab \p{IsBasicLatin} block escape
double ? ? ? ? ? ? ?
identifying ASCII characters, sim-
Content: (annotation?) </minLength> value = anySimpleType> duration ? ? ? ? ? ? ? . (dot) all characters except newline ilar IsGreek, IsHebrew, IsThai for
Content: (annotation?) and return
<maxLength id = ID ENTITIES ? ? ? ? ? these ranges of Unicode blocks
</minExclusive> \s space characters (space, tab,
fixed = boolean : false ENTITY ? ? ? ? ? ? \p{L} all Letters
newline, return)
value = nonNegativeInteger > <minInclusive id = ID float ? ? ? ? ? ? ? \p{M} all Marks
Content: (annotation?) </maxLength> fixed = boolean : false \S non-Space characters
gDay ? ? ? ? ? ? ? \p{N} all Numbers
value = anySimpleType> \i initial XML name characters (let-
<pattern id = ID gMonth ? ? ? ? ? ? ?
ter _ ;)
\p{P} all Punctuation
Content: (annotation?)
value = anySimpleType gMonthDay ? ? ? ? ? ? ? \p{Z} all Separators
</minInclusive> \I not initial XML name characters
Content: (annotation?) </pattern> gYear ? ? ? ? ? ? ? \p{S} all Symbols
\c XML NameChar characters
<totalDigits id = ID
<enumeration id = ID gYearMonth ? ? ? ? ? ? ?
\C not XML NameChar characters
\p{C} all Others. Additional modifying
fixed = boolean : false
value = anySimpleType > hexBinary ? ? ? ? ? ? values like Lu = uppercase,
value = positiveInteger > \d decimal digits Ll = lowercase, Nd = decimal
Content: (annotation?) ID ? ? ? ? ? ?
Content: (annotation?) \D not decimal digits digit, Sm = math symbols,
</enumeration> IDREF ? ? ? ? ? ?
Sc = currency
</totalDigits> \w XML Letter or Digit characters
? ? ? ? ?
<whiteSpace id = ID IDREFS \P{} not the block or category,
fixed = boolean : false <fractionDigits id = ID int ? ? ? ? ? ? ? ? ? ? \P{IsGreek} = not Greek block
value = (collapse | preserve | replace)> fixed = boolean : false integer ? ? ? ? ? ? ? ? ? ?

Content: (annotation?) value = nonNegativeInteger > language ? ? ? ? ? ? Character References


</whiteSpace> Content: (annotation?) &#x4E; or &#99; for hex or decimal XML character references
long ? ? ? ? ? ? ? ? ? ?
</fractionDigits>
? ? ? ? ? ?
<maxInclusive id = ID Name Repetition Operators
fixed = boolean : false NCName ? ? ? ? ? ?
* = 0 or more, ? 0 or 1, + 1 or more
value = anySimpleType> negativeInteger ? ? ? ? ? ? ? ? ? ?

Content: (annotation?) NMTOKEN ? ? ? ? ? ? Interval Operators


</maxInclusive> ? ? ? ? ?
{x,y} range x to y, {x,} at least x, {x} exactly x, i.e. {4,8} 4 to 8
NMTOKENS
nonNegativeInteger ? ? ? ? ? ? ? ? ? ? Range Expressions
nonPositiveInteger ? ? ? ? ? ? ? ? ? ? [a-zA-Z] = character a to z upper and lower case
normalizedString ? ? ? ? ? ? [0-9] = digits 0 to 9
fra c tio n D ig its
m a x In c lu s iv e
m a xE c lu siv e
m in E x c lu s iv e
e n u m e ra tio n

m in In c lus iv e
w h ite S p a c e

NOTATION ? ? ? ? ? ?
m in L e n g th
m a xL e n g th

to ta lD ig its

Data Type positiveInteger ? ? ? ? ? ? ? ? ? ?


pa tte rn
le n gth

QName ? ? ? ? ? ?

short ? ? ? ? ? ? ? ? ? ?

string ? ? ? ? ? ?
anyURI ? ? ? ? ? ?
time ? ? ? ? ? ? ?
base64Binary ? ? ? ? ? ?
token ? ? ? ? ? ?
boolean ? ?
unsignedByte ? ? ? ? ? ? ? ? ? ?
byte ? ? ? ? ? ? ? ? ? ?
unsignedInt ? ? ? ? ? ? ? ? ? ? ©2001 D Vint Productions
date ? ? ? ? ? ? ?
unsignedLong ? ? ? ? ? ? ? ? ? ? xmlhelp@ dvint.com
dateTime ? ? ? ? ? ? ?
unsignedShort ? ? ? ? ? ? ? ? ? ? http://w w w .xm l.dvint.com

You might also like