0% found this document useful (0 votes)
41 views

Schema Data Types

The document provides details on XML Schema data types including their names, descriptions, and relevant specification sections. It includes numeric, string, binary, and logical data types. The document also lists some built-in types like anyType and anySimpleType.

Uploaded by

msaipraneeth
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
41 views

Schema Data Types

The document provides details on XML Schema data types including their names, descriptions, and relevant specification sections. It includes numeric, string, binary, and logical data types. The document also lists some built-in types like anyType and anySimpleType.

Uploaded by

msaipraneeth
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

long derived integer 9223372036854775807 to - N O T A T IO N atomic NOTATION type §3.2.

19 pt2
9223372036854775808. Sign omitted, “+” QName atomic XML qualified names §3.2.18 pt2
assumed.
XML Schema - Data Types Example: -1, 0, 12678967543233, +100000.
§3.3.16 pt2
Following types should only be used in attribute declaration for XML compatibility:
ENTITY derived ENTITY attribute type §3.3.11 pt2

Quick Reference negativeInteger derived


nonPositive
Infinite set {...,-2,-1}.
Example: -1, -12678967543233, -100000. ENTITIES
NCName
derived ENTITIES attribute type §3.3.12 pt2
§3.3.15 pt2 ENTITY
ver 1/03 n o n N e g a t i v e I n t e g e r derived integer Infinite set {0, 1, 2,...}. Sign omitted, “+” ID derived ID attribute type §3.3.8 pt2
assumed. NCNAME
©2002, 2003 D Vint Productions Example: 1, 0, 12678967543233, +100000. IDREF derived IDREF attribute type §3.3.9 pt2
xmlhelp@ dvint.com §3.3.20 pt2 NCName
http://w w w .xm l.dvint.com nonPositiveInteger derived integer Infinite set {...,-2,-1,0}. Example: -1, 0, - IDREFS derived IDREFS attribute type §3.3.10 pt2
126733, -100000. §3.3.14 pt2 IDREF
1 Namespaces §3.1 pt2 positiveInteger derived Infinite set {1, 2,...}. Optional “+” sign,. Exam- NMTOKEN derived NMTOKEN attribute type §3.3.4 pt2
nonNegativeInteger ple: 1, 12678967543233, +100000. token
• http://www.w3.org/2001/XMLSchema
§3.3.25 pt2 NMTOKENS derived NMTOKENS attribute type §3.3.5 pt2
• http://www.w3.org/2001/XMLSchema-datatypes
short derived int 32767 to -32768. Sign omitted, “+” assumed. NMTOKENS
Example: -1, 0, 12678, +10000.
2 Logic Types §3.3.18 pt2
boolean atomic binary-valued logic legal literals {true, false, 1, 0} derived 0 to 255. a finite-length
8 Built-in Types
unsignedByte
§3.2.1.2 pt2 unsignedShort Example: 0, 126, 100. §3.3.24 pt2 anyType ur-type Built-in Complex type definition of Ur-Type. §3.4.7 pt1
definition
unsignedInt derived 0 to 4294967295
3 Binary Data Types unsignedLong Example: 0, 1267896754, 100000. §3.3.22 pt2 anySimpleType ur-type Built-in Simple type definition of Ur-Type. §4.1.6 pt2
definition
base64Binary atomic Base64-encoded arbitrary binary data. §3.2.16 pt2 unsignedLong derived 0 to 18446744073709551615.
atomic Arbitrary hex-encoded binary data. Example, “0FB7” is a nonNegative Example: 0, 12678967543233, 100000.
hexBinary
hex encoding for 16-bit int 4023 (binary 111110110111). §3.3.21 pt2 9 Sim p le Data Type Declaration §4.1.2 pt2
unsignedShort derived unsignedInt 0 to 65535.
§3.2.15 pt2 Note: All schema components allow attributes from non-schema namespaces.
Example: 0, 12678, 10000. §3.3.23 pt2
<simpleType id = ID
4 Text types final = ( ‘#all’| ( ‘list’| ‘union’| ‘restriction’))
6 Date Tim e T y p e s
anyURI atomic A Uniform Resource Identifier Reference (URI). Can be
atomic Calendar date.Format CCYY-MM-DD. Example, May the name = NCName>
absolute or relative, and may have an optional fragment date
31st, 1999 is: 1999-05-31. §3.2.9 pt2 Content: ( annotation ?, ( restriction | list | union )) </simpleType>
identifier. §3.2.17 pt2
language derived natural language identifiers [RFC 1766] dateTime atomic Specific instant of time. ISO 8601 extended format <list id = ID
token Example: en, fr. §3.3.3 pt2 CCYY-MM-DDThh:mm:ss. Example, to indicate 1:20 pm itemType = QName>
normalizedString derived White space normalized strings §3.3.1 pt2
on May the 31st, 1999 for Eastern Standard Time which Content: ( annotation ?, ( simpleType ?)) </list>
is 5 hours behind Coordinated Universal Time (UTC):
string
1999-05-31T13:20:00-05:00. §3.2.7 <union id = ID
string atomic Character strings in XML §3.2.1 pt2 pt2 memberTypes = List of QName>
token derived Tokenized strings. §3.3.2 pt2 duration atomic A duration of time. ISO 8601 extended format Content: ( annotation ?, ( simpleType *)) </union>
normalized- PnYn MnDTnH nMn S. Example, to indicate duration of 1 <restriction id = ID
String year, 2 months, 3 days, 10 hours, and 30 minutes:
base = QName>
P1Y2M3DT10H30M. One could also indicate a duration
Content: ( annotation ?, ( simpleType ?, ( minExclusive | minInclusive |
5 Number Types of minus 120 days as: -P120D. §3.2.6 pt2
maxExclusive | maxInclusive | totalDigits | fractionDigits | length | minLength |
gDay atomic Gregorian day. Example a day such as the 5th of the
byte derived short 127 to-128. Sign is omitted, “+” assumed. maxLength | enumeration | whiteSpace | pattern )*)) </restriction>
Example: -1, 0, 126, +100. §3.3.19 pt2 month is --05. §3.2.13 pt2
.
decimal atomic Arbitrary precision decimal numbers. Sign gMonth atomic Gregorian month. Example: May is --05-- §3.2.14 pt2
omitted, “+” is assumed. Leading and trailing gMonthDay atomic Gregorian specific day in a month.
Example: Feb 5 is --02-05. §3.2.12 pt2 Schema Component Name
zeroes are optional. If the fractional part is (typically prefixed with xsd:)
zero, the period and following zero(es) can be gYear atomic Gregorian calendar year. Example, year 1999, write: Data Type
Required Attribute String Value
omitted. §3.2.3 pt2 1999. §3.2.11 pt2 <notation id = ID
name = NCName
double atomic Double-precision 64-bit floating point type - gYearMonth atomic Specific gregorian month and year. Optional Attributes maxOccurs = ( nonNegativeInteger | ‘unbounded’) : 1
legal literals {0, -0, INF, -INF and NaN} Exam- type = QName >
Example, May 1999, write: 1999-05. §3.2.10 pt2 Content: ( (annotation | (simpleType | complexType | group | Attribute Default Value
ple, -1E4, 12.78e-2, 12 and INF §3.2.5 pt2 tim e atomic An instant of time that recurs every day. Example, 1:20 attributeGroup))*)
Content Model of </notation>
float atomic 32-bit floating point type - legal literals {0, -0, pm for Eastern Standard Time which is 5 hours behind Schema Component
INF, -INF and NaN} Example, -1E4, Coordinated Universal Time (UTC), write: 13:20:00-
1267.43233E12, 12.78e-2, 12 and INF 05:00. §3.2.8 pt2
§3.2.4 pt2
int derived long 2147483647 to -2147483648. Sign omitted, “+” 7 XML Types
is assumed. Example: -1, 0, 126789675,
+100000. §3.3.17 pt2 Name derived XML Names §3.3.6 pt2
token
integer derived decimal Integer or whole numbers - Sign omitted, “+”is
assumed. Example: -1, 0, 12678967543233, NCName derived XML “non-colonized” Names. §3.3.7 pt2
+100000. §3.3.13 pt2 Name
Special Character Sequences
10 Constraining Facets §4.3 pt2 \n newline \p{IsBasicLatin} block escape iden-

fra c tio n D ig its


m a x E xc lu siv e
m a x In c lu s iv e

m in E x clu s iv e
e nu m era tio n

m in In c lu s iv e
w h ite S p ac e
tifying ASCII characters, simi-

m in L e n gth
<length id = ID <maxInclusive id = ID \r return

m ax L e n g th

to ta lD igits
Simple Data Type lar IsGreek, IsHebrew, IsThai
fixed = boolean : false fixed = boolean : false

p a tte rn
\t tab

len g th
value = nonNegativeInteger > value = anySimpleType > for these ranges of Unicode
. (dot) all characters except newline blocks
Content: (annotation?) </length> Content: (annotation?) </maxInclusive> and return
\p{L} all Letters
<minLength id = ID <maxExclusive id = ID IDREF u u u u u u \s space characters (space, tab,
fixed = boolean : false fixed = boolean : false IDREFS \p{M} all Marks
u u u u u newline, return)
value = nonNegativeInteger > value = anySimpleType > int - 2147483647 to -2147483648. u u u u u u u u u \p{N} all Numbers
\S non-Space characters
Content: (annotation?) </minLength> Content: (annotation?) </maxExclusive> integer \p{P} all Punctuation
u u u u u u u u u \i initial XML name characters
<maxLength id = ID <minInclusive id = ID language - RFC 1766] Example: en, fr u u u u u u (letter _ ;) \p{Z} all Separators
fixed = boolean : false fixed = boolean : false list u u u u u u \p{S} all Symbols
\I not initial XML name charac-
value = nonNegativeInteger > value = anySimpleType /> long - 9223372036854775807 to - ters \p{C} all Others. Additional modify-
Content: (annotation?) </maxLength> Content: (annotation?) </minInclusive> 9223372036854775808 u u u u u u u u u
\c XML NameChar characters ing values like Lu = upper-
<pattern id = ID <minExclusive id = ID Name u u u u u u case,
\C not XML NameChar charac-
value = anySimpleType > fixed = boolean : false NCName u u u u u u Ll = lowercase, Nd = decimal
ters
Content: (annotation?) </pattern> value = anySimpleType > negativeInteger u u u u u u u u u digit, Sm = math symbols,
Content: (annotation?) </minExclusive> \d decimal digits Sc = currency
<enumeration id = ID NMTOKEN u u u u u u
value = anySimpleType > <totalDigits id = ID NMTOKENS u u u u u
\D not decimal digits \P{} not the block or category,
Content: (annotation?) </enumeration> fixed = boolean : false nonNegativeInteger u u u u u u u u u \w XML Letter or Digit characters \P{IsGreek} = not Greek block
value = positiveInteger > \W not XML Letter or Digit charac-
<whiteSpace id = ID nonPositiveInteger u u u u u u u u u
Content: (annotation?) </totalDigits> ters
fixed = boolean : false normalizedString u u u u u u
value = ( ‘collapse’| ‘preserve’| <fractionDigits id = ID NOTATION u u u u u u
‘replace’) > fixed = boolean : false Pattern Examples
positiveInteger u u u u u u u u u
Content: (annotation?) </whitespace> value = nonNegativeInteger > Expression M a tch(es)
QName u u u u u u
Content: (annotation?) </fractionDigits>
short - 32767 to -32768 u u u u u u u u u Chapter \d Chapter 0, Chapter 1, Chapter 2....
string u u u u u u
1 1 Si m p le D at a T ypes and Constrai ni ng Fa c e ts §4.1.5 pt2, Chapter followed by a single whitespace character (space,
tim e - h h : m m : s s u u u u u u u Chapter\s\w tab, newline, etc.), followed by a word character (XML 1.0
Appendix B pt0
token u u u u u u Letter or Digit)
union u u Espan&#xF1;ola Española
unsignedByte - 0 to 255 u u u u u u u u u
fra c tio n D ig its
m a x E x c lu s iv e
m a x In c lu s ive

m in E x c lu s iv e
e n u m e ra tio n

m in Inc lu siv e

any uppercase character, the value of \p{} (e.g. “Lu”) is


w hite S p a c e

\p{Lu}
m in L e n g th

unsignedInt - 0 to 4294967295 u u u u u u u u u
m a x L en g th

to ta lD ig its

Simple Data Type defined by Unicode


unsignedLong - 0 to
p atte rn

u u u u u u u u u
le n g th

18446744073709551615 a*x x, ax, aax, aaax....


unsignedShort - 0 to 65535 u u u u u u u u u a?x ax, x
anyURI u u u u u u a+x ax, aax, aaax....
1 2 Regular Expressions for Pattern Facet §4.3.4 pt2
base64Binary u u u u u u
§Appendix D pt0, §Appendix F pt2 (a|b)+x
ax, bx, aax, abx, bax, bbx, aaax, aabx, abax, abbx, baax,
boolean u u babx, bbax, bbbx, aaaax....
byte - 127 to-128 u u u u u u u u u 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 ‘\’
[^0-9]x any non-digit character followed by the character x
date - CCYY-MM-DD u u u u u u u \|.-^?*+{}()[]
\Dx any non-digit character followed by the character x
dateTime - CCYY-MM-DDThh:mm:ss u u u u u u u
Character References
decimal - Arbitrary precision decimal .x any character followed by the character x
u u u u u u u u u &#x4E; or &#99; for hex or decimal XML character references
numbers
.*abc.* 1x2abc, abc1x2, z3456abchooray....
double - Double-precision 64-bit floating
point u u u u u u u Repetition Operators
ab{2}x abbx
duration - PnYn MnDTnH nMn S u u u u u u u * 0 or more, ab{2,4}x abbx, abbbx, abbbbx
ENTITIES u u u u u
? 0 or 1,
ab{2,}x abbx, abbbx, abbbbx....
ENTITY u u u u u u
+ 1 or more
(ab){2}x ababx
float - 32-bit floating point type u u u u u u u
gDay u u u u u u u Interval Operators ver 1/03
gMonth u u u u u u u {x,y} range x to y, {x,} at least x, {x} exactly x, i.e. {4,8} 4 to 8
gMonthDay u u u u u u u
Character Range Expressions ©2002, 2003 D Vint Productions
gYear u u u u u u u xmlhelp@ dvint.com
gYearMonth u u u u u u u
[a-zA-Z] = character a to z upper and lower case http://w w w .xm l.dvint.com
[0-9] = digits 0 to 9
hexBinary u u u u u u
ID u u u u u u

You might also like