Setting max length of date type as 0 in XSD

China☆狼群 提交于 2019-12-02 12:02:11

问题


<xsd:simpleType name="Date10">
  <xsd:restriction base="xsd:date">
    <xsd:pattern value="??"/>
  </xsd:restriction>
</xsd:simpleType>   

The date field shouldn't be able to accept any value in it. I want it to appear like an empty tag. How do I do that?


回答1:


Your requirements contradict each other. You cannot constrain an element to be a date and also to be empty concurrently because dates cannot have zero length.

If you intend to allow either a date or an empty string, see Allow XSD date element to be empty string.



来源:https://stackoverflow.com/questions/47757184/setting-max-length-of-date-type-as-0-in-xsd

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!