This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision | |||
|
notes:xml_schema_cheat_sheet [2026/06/07 09:31] 114.119.135.121 old revision restored (2026/06/02 12:55) |
notes:xml_schema_cheat_sheet [2026/06/07 10:00] (current) 43.110.34.223 old revision restored (2007/10/04 20:05) |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ===== XML Schema ===== | ===== XML Schema ===== | ||
| - | |||
| - | This is a cheat sheet for the XML Schema language. It is a follow up to the [[XML Cheat Sheet]] and summarizes [[http:// | ||
| * XML Schema is an XML-based alternative to DTDs. It is the successor to DTDs because it is richer and more extensible. It describes the structure of an XML document. | * XML Schema is an XML-based alternative to DTDs. It is the successor to DTDs because it is richer and more extensible. It describes the structure of an XML document. | ||
| Line 192: | Line 190: | ||
| < | < | ||
| </ | </ | ||
| - | |||
| ==== Data Types ==== | ==== Data Types ==== | ||
| Line 202: | Line 199: | ||
| * xs:token - No CR, LF or TAB characters are allowed, no leading or trailing spaces are allowed, no sequences of more than one space is allowed | * xs:token - No CR, LF or TAB characters are allowed, no leading or trailing spaces are allowed, no sequences of more than one space is allowed | ||
| - | * There are many other types derived from string e.g. NMTOKEN, QName, ID, IDREF. | + | * There are many other types derived from string e.g. NMTOKEN, QName, ID, IDREF. |
| + | * enumeration | ||
| + | * length | ||
| + | * maxLength | ||
| + | * minLength | ||
| + | * pattern (NMTOKENS, IDREFS, and ENTITIES cannot use this constraint) | ||
| + | * whiteSpace | ||
| === Date Data Types === | === Date Data Types === | ||
| Line 228: | Line 231: | ||
| |gYearMonth |Defines a part of a date - the year and month (YYYY-MM)| | |gYearMonth |Defines a part of a date - the year and month (YYYY-MM)| | ||
| |time |Defines a time value (" | |time |Defines a time value (" | ||
| + | |||
| + | * The following restrictions | ||
| + | * enumeration | ||
| + | * maxExclusive | ||
| + | * maxInclusive | ||
| + | * minExclusive | ||
| + | * minInclusive | ||
| + | * pattern | ||
| + | * whiteSpace | ||
| === Numeric Data types === | === Numeric Data types === | ||
| - | |||
| - | * The xs:decimal data type specifies a positive or negative numeric value (with fractional part). | ||
| - | |||
| - | * The xs:integer data type specifies a positive or negative integer. | ||
| - | |||
| - | * These are all the numeric types, which all derive from the decimal type. | ||
| - | |||
| - | ^Name ^Description^ | ||
| - | |byte |A signed 8-bit integer| | ||
| - | |decimal |A decimal value| | ||
| - | |int |A signed 32-bit integer| | ||
| - | |integer |An integer value| | ||
| - | |long |A signed 64-bit integer| | ||
| - | |negativeInteger |An integer containing only negative values ( .., -2, -1.)| | ||
| - | |nonNegativeInteger |An integer containing only non-negative values (0, 1, 2, ..)| | ||
| - | |nonPositiveInteger |An integer containing only non-positive values (.., -2, -1, 0)| | ||
| - | |positiveInteger |An integer containing only positive values (1, 2, ..)| | ||
| - | |short |A signed 16-bit integer| | ||
| - | |unsignedLong |An unsigned 64-bit integer| | ||
| - | |unsignedInt |An unsigned 32-bit integer| | ||
| - | |unsignedShort |An unsigned 16-bit integer| | ||
| - | |unsignedByte |An unsigned 8-bit integer| | ||
| === Other Data Types === | === Other Data Types === | ||
| - | * xs:boolean is a booleantype which must be true or false | ||
| - | * xs: | ||
| - | * xs:anyURI can be used for any URL or URN. | ||
| - | * There are also xs:double and xs:float data types. | ||