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>
相关推荐
java1234_小锋2 天前
MyBatis中XML映射有哪些标签?
xml·tomcat·mybatis
大腕先生2 天前
通用分页超详细介绍(附带源代码解析&页面展示效果)
xml·java·linux·服务器·开发语言·前端·idea
许彰午5 天前
Spring Boot + Vue 实现 XML 动态表单:固定字段 + 自由扩展方案
xml·vue.js·spring boot
untE EADO5 天前
Tomcat的server.xml配置详解
xml·java·tomcat
zuowei28896 天前
spring实例化对象的几种方式(使用XML配置文件)
xml·java·spring
weixin_520649876 天前
xml json ini 文件语法
xml·java·json
Full Stack Developme6 天前
Hutool XML 操作教程
xml·windows·python
阿亮爱学代码8 天前
初识Android界面布局
android·xml·view·viewgroup
eSsO KERF9 天前
使用 Logback 的最佳实践:`logback.xml` 与 `logback-spring.xml` 的区别与用法
xml·spring·logback