I am defining an XSD. I need to define an element which takes date in format yyyymmdd. How can I define a restriction in XSD to only accept this format?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You could always define it as a restricted simple type based on a string, restricted by a regular expression:
If you want to get really smart, you can tweak the regular expression to be even more of a match for a date (e.g. contains the info that month can only be 01 – 12 and so forth):
Marc