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>
相关推荐
利刃大大2 天前
【Mybatis】Mybatis入门 && 基础操作 && XML配置文件开发 && 多表查询 && 注入问题 && 数据库连接池
xml·数据库·mybatis
墨痕诉清风3 天前
java漏洞集合工具(Struts2、Fastjson、Weblogic(xml)、Shiro、Log4j、Jboss、SpringCloud)
xml·java·struts·安全·web安全·spring cloud·log4j
Lbwnb丶3 天前
failure: repodata/repomd.xml from base: [Errno 256] No more mirrors to try.
xml
拾忆,想起3 天前
设计模式三大分类完全解析:构建高质量软件的基石
xml·微服务·设计模式·性能优化·服务发现
前网易架构师-高司机3 天前
汽车充电插口识别数据集,可识别快充,慢充插口,支持yolo,coco json,pascal voc xml格式的标注数据集
xml·yolo·汽车·快充·充电·m慢充·插口
武藤一雄3 天前
彻底吃透.NET中序列化反序列化
xml·微软·c#·json·.net·.netcore
spencer_tseng3 天前
org.eclipse.wst.common.project.facet.core.xml could not be read.
xml·java·eclipse
小鸡吃米…4 天前
Python - XML 处理
xml·开发语言·python·开源
老歌老听老掉牙4 天前
Vericut 5轴机床MCH文件解析与构建指南
xml·python·vericut
ii_best4 天前
「安卓开发辅助工具按键精灵」xml全分辨率插件jsd插件脚本教程
android·xml·开发语言·编辑器·安卓