XML Schema中的simpleContent 元素出现在complexType 内部,是对complexType 的一种扩展、或者限制
simpleContent 元素complexType元素内部最多只能出现1次。
simpleContent元素下面必须包含1个restriction或者extension元素

例如,下面的Schema片段,定义一个复杂类型condition,它的值是字符串类型包含nametype两个可选属性

<xs:element name="condition" maxOccurs="unbounded" minOccurs="0"&gt;
  <xs:complexType&gt;
    <xs:simpleContent&gt;
      <xs:extension base="xs:string"&gt;
        <xs:attribute type="xs:string" name="name" use="optional"/&gt;
        <xs:attribute type="xs:string" name="type" use="optional"/&gt;
      </xs:extension&gt;
    </xs:simpleContent&gt;
  </xs:complexType&gt;
</xs:element&gt;

符合上面Schema的一段xml数据

<condition name='lD" type="eq">26</condition>
<condition name='DATE" type="lt">20231120</condition>

原文地址:https://blog.csdn.net/panghuangang/article/details/134625670

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任

如若转载,请注明出处:http://www.7code.cn/show_16559.html

如若内容造成侵权/违法违规/事实不符,请联系代码007邮箱suwngjj01@126.com进行投诉反馈,一经查实,立即删除

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注