AI-generated Key Takeaways
-
Basic data types in XML, such as strings, dates/times, and languages, must adhere to specific formatting and content requirements.
-
Strings should be trimmed, presented in title case when appropriate for readability, and utilize XML escape characters for special characters.
-
Dates and times must follow the ISO-8601 format (
YYYY-MM-DDThh:mm:ssXzh:zm), including specific time zone offsets from UTC. -
Language codes should conform to RFC 3066, preferably using lowercase primary language tags (e.g.,
en-US).
The following general requirements apply to the content and format of basic data types in the XML specification.
xs:string
Trim any excess whitespace before or after the string.
To aid readability, if you present a lowercase string like
tornado warningto end users, then convert the data to title case, when possible. In other words, changetornado warningtoTornado Warning.Don't use unsupported punctuation, and use XML escape characters when appropriate. For example, use
&instead of&.
xs:dateTime
Use ISO-8601 format in the form of YYYY-MM-DDThh:mm:ssXzh:zm, defined as
follows:
YYYYindicates the year.MMindicates the month.DDindicates the day.Tindicates the symbol "T" and marks the start of the required time section.hhindicates the hour.mmindicates the minute.ssindicates the second.Xindicates one of these symbols:"+" if the preceding date and time are in a time zone ahead of UTC.
"-" if the preceding date and time are in a time zone behind UTC, or if the time is in UTC.
zhindicates the hours of offset from the preceding date and time to UTC, or00if the preceding time is in UTC.zmindicates the minutes of offset from the preceding date and time to UTC, or00if the preceding time is in UTC.
As an example, for May 24, 2002 at 16:49 PDT, use 2002-05-24T16:49:00-07:00.
Don't use alphabetic time zone designations like "Z." You must represent the
time zone for UTC as -00:00.
xs:language
As described in the CAP standard, represent languages by a valid RFC 3066 identifier. We recommend that you designate only primary language tags in lowercase.
An example is en-US.