Page Summary
-
Simple data types in the XML spec have general requirements for content and formatting.
-
For
xs:string, trim whitespace and convert to Title Case for readability. -
xs:date,xs:dateTime, andPartialDateshould be in ISO-8601 format, withPartialDateallowing different levels of specificity. -
xs:booleanvalues should be eithertrueorfalse(case-sensitive). -
xs:languageshould be a two-character, lower-case ISO 639 value.
The following are general requirements for the content and formatting of simple data types in the XML spec.
xs:string
Keep the following best practices in mind when you use the xs:string data
type:
- Always trim the string to remove leading and trailing white space.
- If the string is presented to end users, such as with party names, office titles, or proper names, convert the data to Title Case when possible to aid readability.
Dates and times
xs:date
When you use the xs:date data type, enter it in
ISO-8601 format.
xs:dateTime
When you use the xs:dateTime data type, enter it in
ISO-8601 format.
PartialDate
PartialDate is a union that lets you set dates in
ISO-8601 format at different levels of
specificity:
- Specific date as
YYYY-MM-DD - Period of one month as
YYYY-MM - Period of one year as
YYYY
xs:boolean
When you use the xs:boolean data type, enter it with a value of either true
or false (case-sensitive).
xs:language
When you use the xs:language data type, enter it as a two-character,
lower-case value that corresponds to the ISO
639 standard.