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

XML Schema attributeGroup 元素

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

定义和用法

attributeGroup 元素用于对属性声明进行组合,这样这些声明就能够以组合的形式合并到复杂类型中。

元素信息

出现次数 无限制
父元素 attributeGroup、complexType、schema、restriction (simpleContent)、extension (simpleContent)、restriction (complexContent)、extension (complexContent)
内容 annotation、attribute、attributeGroup、anyAttribute

语法

<attributeGroup
id=ID
name=NCName
ref=QName
any attributes
>

(annotation?),((attribute|attributeGroup)*,anyAttribute?))

</attributeGroup>

(? 符号声明在 attributeGroup 元素中,元素可出现零次或一次,* 符号声明元素可出现零次或多次。)

属性 描述
id 可选。规定该元素的唯一的 ID。
name 可选。规定属性组的名称。name 和 ref 属性不能同时出现。
ref 可选。规定对指定的属性组的引用。name 和 ref 属性不能同时出现。
any attributes 可选。规定带有 non-schema 命名空间的任何其他属性。

实例

<xs:attributeGroup name="personattr">
  <xs:attribute name="attr1" type="string"/>
  <xs:attribute name="attr2" type="integer"/>
</xs:attributeGroup>

<xs:complexType name="person">
  <xs:attributeGroup ref="personattr"/>
</xs:complexType>

上面的例子定义了一个名为 "personattr" 的属性组,在名为 "person" 的复杂类型中使用。

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

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

快速入口

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

其它栏目

· 建站教程
· 365学习

业务咨询

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

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

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