XML Schema中的simpleContent 元素

XML Schema中的simpleContent 元素出现在complexType 内部,是对complexType 的一种扩展、或者限制。

simpleContent 元素在complexType元素内部最多只能出现1次。

simpleContent元素下面必须包含1个restriction或者extension元素。

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

复制代码
<xs:element name="condition" maxOccurs="unbounded" minOccurs="0">
  <xs:complexType>
    <xs:simpleContent>
      <xs:extension base="xs:string">
        <xs:attribute type="xs:string" name="name" use="optional"/>
        <xs:attribute type="xs:string" name="type" use="optional"/>
      </xs:extension>
    </xs:simpleContent>
  </xs:complexType>
</xs:element>

符合上面Schema的一段xml数据:

复制代码
<condition name='lD" type="eq">26</condition>
<condition name='DATE" type="lt">20231120</condition>
相关推荐
qqqahhh11 小时前
xml文件的动态化配置,导入
xml·spring·springboot
吴声子夜歌15 小时前
Maven——pom.xml详解
xml·java·maven
iSee8571 天前
struts2 XML外部实体注入漏洞复现(CVE-2025-68493)
xml·安全·struts2
爱吃土豆的马铃薯ㅤㅤㅤㅤㅤㅤㅤㅤㅤ3 天前
mapper.xml中的大于等于、小于等于
xml
问水っ4 天前
Qt Creator快速入门 第三版 第17-2章 XML
xml
独断万古他化4 天前
【MyBatis 深度解析】注解操作与 XML 配置:增删改查全流程实现
xml·java·spring·mybatis
odoo中国4 天前
如何在 Odoo 19 中加载演示数据
xml·csv·odoo·odoo 19·odoo 演示数据加载
web守墓人6 天前
【前端】ikun-pptx编辑器前瞻问题五:pptx中的xml命名空间
xml·前端
h7ml6 天前
企业微信回调模式解析:从XML到POJO的自定义JAXB编解码器设计
xml·java·企业微信
Full Stack Developme6 天前
达梦(DM8)对 JSON 与 XML 的使用教程
xml·数据库·json