您现在的位置: 365建站网 > 建站教程 > Schema 教程 > XML Schema simpleContent 元素

XML Schema simpleContent 元素

此节有 203 人学习过     参与评论

定义和用法

simpleContent 元素包含对 complexType 元素(它以字符数据或 simpleType 元素为内容)的扩展或限制并且不包含任何元素。

元素信息

出现次数 一次
父元素 complexType
内容

可选项 — annotation

必选项 — 有并且只有一个下列元素: restriction (simpleContent) 或 extension (simpleContent)。

语法

<simpleContent
id=ID
any attributes
>

(annotation?,(restriction|extension))

</simpleContent>

(? 符号声明在 simpleContent 元素中该元素可出现零次或一次。)

属性 描述
id 可选。规定该元素的唯一的 ID。
any attributes 可选。规定带有 non-schema 命名空间的任何其他属性。

实例

例子 1

这是一个仅包含文本的 XML 元素 (<shoesize>):

<shoesize country="france">35</shoesize>

下面的例子声明了一个复杂类型 "shoesize",其内容被定义为整数数据类型,并带有一个 country 属性:

<xs:element name="shoesize">
  <xs:complexType>
    <xs:simpleContent>
      <xs:extension base="xs:integer">
        <xs:attribute name="country" type="xs:string" />
      </xs:extension>
    </xs:simpleContent>
  </xs:complexType>
</xs:element>

如对本文有疑问,请提交到交流论坛,广大热心网友会为你解答!! 点击进入论坛

发表评论 (203人查看0条评论)
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
昵称:
最新评论
------分隔线----------------------------
Schema 教程目录

快速入口

· 365软件
· 杰创官网
· 建站工具
· 网站大全

其它栏目

· 建站教程
· 365学习

业务咨询

· 技术支持
· 服务时间:9:00-18:00
365建站网二维码

Powered by 365建站网 RSS地图 HTML地图

copyright © 2013-2024 版权所有 鄂ICP备17013400号