【问题标题】:how to create simple derived type from XSD如何从 XSD 创建简单的派生类型
【发布时间】:2014-02-14 05:29:29
【问题描述】:

如何基于 xs:ID 在您的 XSD 文件中创建派生的 simpleType。限制应使用值以“_”开头的模式,后跟两个 1 - 8 范围内的数字字符。

xml 中的元素

  <piece identifier="p" postion="_44"></piece>

XSD

     <xs:attribute name="postion">
                         <xs:simpleType>
                           <xs:restriction base="xs:ID">
                             <xs:pattern value="??">
                           </xs:restriction>
                         </xs:simpleType>

【问题讨论】:

    标签: xml xsd rex


    【解决方案1】:

    redexp 是 _[1-8][1-8]

     <xs:attribute name="postion">
                         <xs:simpleType>
                           <xs:restriction base="xs:ID">
                             <xs:pattern value="_[1-8][1-8]">
                           </xs:restriction>
                         </xs:simpleType>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-02-21
      • 1970-01-01
      • 2013-12-02
      • 2020-05-23
      • 1970-01-01
      • 1970-01-01
      • 2011-01-16
      相关资源
      最近更新 更多