Isaac
Isaac

Reputation: 16736

XML Schema: mandating timezone on xsd:date

Is it at all possible, when defining an XML schema, to mandate that an element of type xsd:date must contain timezone information?

I was reading the XML Schema specification for xsd:date, and it seems to me that there's no way to actually guarantee this without resorting to use regular expressions, which I certainly don't want to do.

Am I missing something, or am I doomed?

Upvotes: 0

Views: 119

Answers (1)

C. M. Sperberg-McQueen
C. M. Sperberg-McQueen

Reputation: 25034

In XSD 1.0, regular expressions are the usual answer (and probably the only one).

In XSD 1.1, you can and should use the explicitTimezone facet to derive a restriction of date that requires timezone information.

Upvotes: 1

Related Questions