Site Tools


notes:xml_schema_cheat_sheet

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
notes:xml_schema_cheat_sheet [2026/06/04 11:05]
47.79.51.50 old revision restored (2007/10/04 19:31)
notes:xml_schema_cheat_sheet [2026/06/07 10:00] (current)
43.110.34.223 old revision restored (2007/10/04 20:05)
Line 41: Line 41:
   * By default an attribute is optional, to make it required add  use="required" .   * By default an attribute is optional, to make it required add  use="required" .
  
-==== XML Facets / Restrictions ====+==== Facets / Restrictions ====
  
   * XML Facets are restrictions on the acceptable values for elements or attributes.   * XML Facets are restrictions on the acceptable values for elements or attributes.
Line 151: Line 151:
  
  
-==== XSD Element Indicators ====+==== Element Indicators ====
  
   * Indicators control how elements are to be used within a complex element. There are three types of indicators: order indicators, occurrence indicators and group indicators   * Indicators control how elements are to be used within a complex element. There are three types of indicators: order indicators, occurrence indicators and group indicators
Line 191: Line 191:
 </code> Substitution can be blocked with <code><xs:element name="name" type="xs:string" block="substitution"/></code> </code> Substitution can be blocked with <code><xs:element name="name" type="xs:string" block="substitution"/></code>
  
-==== XSD Data Types ====+==== Data Types ==== 
 + 
 +=== String Data Types === 
 + 
 +  * Apart from xs:string there are two other string stypes : 
 +    * xs:normalizedString - No CR, LF or TAB characters are 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. The following restrictions can be used with string types 
 +    * enumeration 
 +    * length 
 +    * maxLength 
 +    * minLength 
 +    * pattern (NMTOKENS, IDREFS, and ENTITIES cannot use this constraint) 
 +    * whiteSpace 
 + 
 +=== Date Data Types === 
 + 
 +  * date data type is used to specify a date in the format "YYYY-MM-DD" where all components are required. 
 + 
 +  * A time data type must be specified in the following format "hh:mm:ss" where all components are required. 
 + 
 +  * A dateTime datatype must be specified in the following format "YYYY-MM-DDThh:mm:ss" e.g. 2002-05-30T09:00:00 
 + 
 +  * A timezone can be added to a date/time/dateTime by adding a Z (for UTC) or a signed offset at the end e.g. 2002-09-24Z , 2002-09-24+06:00 
 + 
 +  * A duration data type must be specified in the following format "[-]PnYnMnDTnHnMnS" P is required, T is required if any time component is used and the other parts are optional e.g. P5Y, P5Y2M10DT15H, -P1Y 
 + 
 +  * This is a list of all date types. 
 + 
 +^ Type ^     Description                    ^ 
 +| date | Defines a date value ("YYYY-MM-DD")| 
 +|dateTime |Defines a date and time value ("YYYY-MM-DDThh:mm:ss")| 
 +|duration |Defines a time interval ([-]PnYnMnDTnHnMnS)| 
 +|gDay |Defines a part of a date - the day (DD)| 
 +|gMonth |Defines a part of a date - the month (MM)| 
 +|gMonthDay |Defines a part of a date - the month and day (MM-DD)| 
 +|gYear |Defines a part of a date - the year (YYYY)| 
 +|gYearMonth |Defines a part of a date - the year and month (YYYY-MM)| 
 +|time |Defines a time value ("hh:mm:ss") | 
 + 
 +  * The following restrictions  can be used with Date data types: 
 +    * enumeration 
 +    * maxExclusive 
 +    * maxInclusive 
 +    * minExclusive 
 +    * minInclusive 
 +    * pattern 
 +    * whiteSpace 
 + 
 +=== Numeric Data types === 
 + 
 +=== Other Data Types ===
  
notes/xml_schema_cheat_sheet.1780596355.txt.gz · Last modified: 2026/06/04 11:05 by 47.79.51.50