I am trying to define an XML Schema for a flat file. One of the fields is a date in the format mm/dd/yyyy. Is there some where that I can go to find a definition of the SimpleType to validate such a field?
Appendix D of part II of the W3C Schema specification details the built-in types for handling dates (https://www.w3.org/TR/xmlschema-2/#isoformats). I would urge you to use the built-in types rather than create your own where possible.
This is especially true in the case of dates because, although it is theoretically possible to validate dates (taking account of leap years etc.) using regular expressions, such as can be used with SimpleType, can get very complicated. (http://lists.xml.org/archives/xml-dev/200101/msg00840.html).
Dig Deeper on Topics Archive
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.