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>
相关推荐
x17388062731 天前
XXE外部实体注入
xml·笔记
云水一下3 天前
零基础玩转bWAPP靶场(三十):XML/XPath 注入(登录表单)
xml·web安全·bwapp
云水一下3 天前
零基础玩转bWAPP靶场(三十一):XML/XPath 注入(搜索)
xml·web安全·bwapp
w67820075 天前
,攻击者通过构造特殊的XML使其包含恶意外部实体。外部实体可以为服务器敏感文件,也可以为网络请求等,之后利用方式类似于文件包含和SS ...
xml·服务器·网络
name好难取诶5 天前
解析请求体内容(如 JSON、表单数据、XML 等) 将原始数据转换为 Python 数据结构 使转换后的数据可在 request. ...
xml·python·json
qq_171538855 天前
深入浅出 MyBatis XML:从入门到精通
xml·java·mybatis
前网易架构师-高司机11 天前
带标注的扑克牌识别数据集,识别率99.5%,3083张图,支持yolo,coco json,voc xml,文末有模型训练代码
xml·yolo·json·数据集·数字·扑克牌·纸牌
执明wa12 天前
LayoutInflater详解: XML是如何变成View的?
android·xml·开发语言·android studio
IT_Octopus14 天前
一次由 RestTemplate 引发的 Connection reset:被 XML 截胡的请求体
xml·java·spring boot
Dontla14 天前
网站爬虫控制策略介绍(robots.txt、sitemap.xml、x-robots-tag、noindex、nofollow)网站索引
xml·爬虫·dubbo