当前位置: 首页 > 网络学院 > XML相关教程 > Schema (XSD) > XML Schema unique 元素

Schema (XSD)
Schema (XSD) 介绍
为何使用 XML Schemas?
如何定制 XSD
XSD - <schema>元素
XSD 简单元素
XSD 属性
XSD 约束面
XSD 复合元素
XSD 复合空元素
XSD 复合纯元素
XSD 复合纯文本
XSD 混合内容的复合类型
XSD 指示器复合类型
XSD <any> 元素
XSD <anyAttribute> 元素
XSD 元素替代
XSD 实例
XSD 字符串数据类型
XSD 日期数据类型
XSD 小数数据类型

Schema (XSD) 中的 XML Schema unique 元素


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-04   浏览: 284 ::
收藏到网摘: n/a

Definition and Usage
定义和用法

The unique element defines that an element or an attribute value must be unique within the scope.
unique 元素的作用是:定义了一个元素或一个属性值,该元素和属性值在对应的范围内是独一无二的。

The unique element MUST contain the following (in order):
key[键]元素必须按顺序包含下列内容:

  • one and only one selector element  (contains an XPath expression that specifies the set of elements across which the values specified by field must be unique)
    一个或仅有一个selector [选择器] 元素 (包含一个用于指定一组元素的表达式,该组元素中的字段值必须是独一无二的)
  • one or more field elements (contains an XPath expression that specifies the values that must be unique for the set of elements specified by the selector element)
    一个或多个字段元素(包含一个用于指定值的表达式,该值在selector元素指定的元素组中必须是独一无二的)

Element Information
元素信息

  • Parent elements: element
    父类元素:element[元素]

Syntax
语法

<unique
id=ID
name=NCName
any attributes
>
(annotation?,(selector,field+))
</unique>

(The ? sign declares that the element can occur zero or one time inside the unique element)
“?”符号用于声明元素在unique元素中允许出现的次数(0次或1次)

属性 描述
id Optional. Specifies a unique ID for the element
可选参数。为元素指定一个独立的ID
name Required. Specifies a name for the element
必要参数。为元素指定一个名称
any attributes Optional. Specifies any other attributes with non-schema namespace
可选参数。指定非schema命名空间的其它属性

评论 (0) All

登陆 | 还没注册?