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>
相关推荐
Kika写代码15 小时前
【Android】UI开发:XML布局与Jetpack Compose的全面对比指南
android·xml·ui
stevenzqzq1 天前
Android studio xml布局预览中 Automotive和Autotive Distant Display的区别
android·xml·android studio
兰琛1 天前
Compose组件转换XML布局
android·xml·kotlin
inxunoffice1 天前
按规则批量修改 txt/html/json/xml/csv/记事本等文本文件内容
xml·json
XiaoLeisj3 天前
【MyBatis】深入解析 MyBatis XML 开发:增删改查操作和方法命名规范、@Param 重命名参数、XML 返回自增主键方法
xml·java·数据库·spring boot·sql·intellij-idea·mybatis
chushiyunen4 天前
dom操作笔记、xml和document等
xml·java·笔记
whisperrr.4 天前
【spring01】Spring 管理 Bean-IOC,基于 XML 配置 bean
xml·java·spring
努力搬砖的咸鱼4 天前
Qt中的数据解析--XML与JSON处理全攻略
xml·开发语言·qt·json
inxunoffice4 天前
批量删除 txt/html/json/xml/csv 等文本文件中的重复行
xml
andy55204 天前
.NET 使用 WMQ 连接Queue 发送 message 实例
xml·c#·wmq·c# 连接wmq·发送消息到wmq