Stefan Reiter wrote:
Hi, I want to limit a date to a minDate and a maxDate -
I assume it is only possible with "pattern".
Using minInclusive and maxInclusive for example works for me with MSXML
4 and with Xerces-Java, example schema is
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
version="1.0">
<xs:element name="root">
<xs:complexType>
<xs:sequence>
<xs:element name="date" maxOccurs="unbounded">
<xs:simpleType>
<xs:restriction base="xs:date">
<xs:minInclusive value="2005-01-01" />
<xs:maxInclusive value="2006-01-01" />
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Example XML document is
<root>
<date>2005-03-01</date>
<date>2005-01-01</date>
<date>2006-01-01</date>
<date>2007-01-01</date>
</root>
The last date element is flagged by both validators as being invalid.
I am not sure however why <http://www.w3.org/TR/xmlschema-2/#date> does
not list any possible constraining facets for that date data type.
--
Martin Honnen
http://JavaScript.FAQTs.com/