The canonical description of date and time and duration is ISO8601. That specification is broken into date-time and duration. This is a question about duration. Duration in ISO8601 allows one to express simple durations P1W (1 Week) and complex duration P18Y9M4DT11H9M8S (18 years, 9 months, 4 days, 11 hours, 9 minutes and 8 seconds) When XSD was being developed, the string format defined for the Duration type did not include the full range of Durations as defined in ISO8601. The most common calendaring standard, iCalendar (currently RFC 5545) also uses strings derived from IS8601. It also did not include the full range of Durations as defined in ISO8601. To make things more interesting, it specified a different sub-set than did the XSD folks. I am working right now on defining schemas that implement the full range of string variables for Duration as defined in ISO8601. Using the traditional software principal that it is always better to borrow rather than create…. Does anyone know a set of public schemas that have already defined the string restrictions and patterns to validate the full ISO8601 set for durations in an XSD? Thanks tc "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." - Brian W. Kernighan
|