| Workshops --> XML --> Demo --> schema5.html |
|---|
![]() |
|
This is an element that can contain only text strings
The content could take any number of forms (numbers, letters, dates...)
| Datatype | Meaning | |
|---|---|---|
| xsd:string | Alphanumeric characters | |
| xsd:decimal | Numbers with decimal points | |
| xsd:boolean | Contains conditional stratement (true/false; 0/1) | |
| xsd:uri-reference | Contains a URL | |
| xsd:date | Year, month, day | |
| xsd:time | Hours, minutes, seconds | |
| xsd:language | Two character ISO language code | |
| custom | One you make up |
The <xsd:time> datatype can be broken down to include more specific content
| Time datatype | Meaning | Format | Schema example | As XML | ||||
|---|---|---|---|---|---|---|---|---|
| xsd:time | Greenwich mean time: EST is UTC-5 | hh:mm:ss.sssUTC_time_zone | <xsd:element name="alien_visit" type="xsd:time"/> | <alien_visit>22:15-35-14</alien_visit> | ||||
| xsd:duration | A bounded period of time | PYrMoDTHrMmSs | <xsd:element name="alien_visit" type="xsd:duration"/> | <alien_visit>P4D</alien_visit> | ||||
| xsd:timeinstant | A specific moment | Full_yr-Mo-DTHrMmSs | <xsd:element name="alien_visit" type="xsd:timeinstant"/> | <alien_visit>1960-07-08T-519:22:45.32</alien_visit> | ||||
| xsd:date | A specific date | Full_yr-Mo-D | <xsd:element name="alien_visit" type="xsd:date"/> | <alien_visit>1960-07-08</alien_visit> | ||||
| xsd:gYearMonth | A specific month | Full_yr-Mo | <xsd:element name="alien_visit" type="xsd:gYearMonth"/> | <alien_visit>1960-07</alien_visit> | ||||
| xsd:gYear | A specific year | Full_yr | <xsd:element name="alien_visit" type="xsd:gYear"/> | <alien_visit>1960</alien_visit> | ||||
| xsd:recurringDate | A specific day in a specific month without the year | --Mo-D | <xsd:element name="alien_visit" type="xsd:recurringDate"/> | <alien_visit>--08-23</alien_visit> | ||||
| xsd:recurringDay | A specific day without the year and month | ---D | <xsd:element name="alien_visit" type="xsd:recurringDay"/> | <alien_visit>---15</alien_visitt> |
There is also a set of datatypes for working with numbers
| Number datatype | Meaning | Format | Schema example | As XML | ||||
|---|---|---|---|---|---|---|---|---|
| xsd:decimal | Positive or negative numbers | #, -#, #.## | <xsd:element name="alien_visit" type="xsd:decimal"/> | <alien_visit>45.3</alien_visit> | ||||
| xsd:integer | Positive or negative whole numbers | #, -# | <xsd:element name="alien_visit" type="xsd:integer"/> | <alien_visit>62</alien_visit> | ||||
| xsd:positiveInteger | Only positive whole numbers | # | <xsd:element name="alien_visit" type="xsd:positiveInteger"/> | <alien_visit>165</alien_visit> | ||||
| xsd:negativeInteger | Only negative whole numbers | -# | <xsd:element name="alien_visit" type="xsd:negativeInteger"/> | <alien_visit>-13</alien_visit> | ||||
| xsd:nonNegativeInteger | Only positive whole numbers (not "0") | # | <xsd:element name="alien_visit" type="xsd:nonNegativeInteger"/> | <alien_visit>45</alien_visit> | ||||
| xsd:nonPositiveIntegers | Only negative numbers (not "0") | -# | <xsd:element name="alien_visit" type="xsd:nonPositiveIntegers"/> | <alien_visit>-35</alien_visit> |
It is also possible to create custom simple datatypes
|
||||||||||||||||||||||||
| Page by Howard Rosenbaum | |
| Find me at hrosenba@indiana.edu | You are here: http://www.slis.indiana.edu/hrosenba/www/Workshops/XML/Demo/schema5.html |