Fork me on GitHub

用 正则表达式 限定XML simpleType 定义

 <xsd:simpleType name="ResTrictions">
    <xsd:restriction base="xsd:string">
      <xsd:pattern value="\s*0x[0-9,a-z,A-Z]{8}\s*|\s*"/>
    </xsd:restriction>
  </xsd:simpleType>
View Code

匹配各种空值或者4个byte的16进制数

<test></test>

<test>0x14223344</test>

posted @ 2016-02-26 16:26  HarlanC  阅读(209)  评论(0编辑  收藏  举报