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

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 keyref 元素


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

Definition and Usage
定义和用法

The keyref element specifies that an attribute or element value correspond to those of the specified key or unique element.
keyref元素的作用是:指定与特定的键[key]或独立元素向对应的元素值。

The keyref element MUST contain the following (in order):
keyref元素必须按顺序包含下面的内容

  • 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
语法

<keyref
id=ID
name=NCName
refer=QName
any attributes
>
(annotation?,(selector,field+))
</include>

(The ? sign declares that the element can occur zero or one time, and the + sign declares that the element must occur one or more times inside the keyref element)
“?”符号用于声明元素可以出现的次数(0次或1次),“+”符号用于声明元素可以在keyref元素中出现的次数(1次或多次)。

属性 描述
id Optional. Specifies a unique ID for the element
可选参数。为元素指定一个独立的ID
name Required. Specifies the name of the keyref element
必要参数。指定keyref 元素的名称
refer Required. Specifies the name of a key or unique element defined in this or another schema
必要参数。指定在当前这个schema元素中或其它的schema元素中定义的键[key]名或独立元素名
any attributes Optional. Specifies any other attributes with non-schema namespace
可选参数。指定其它的属性(这些属性无schema命名空间)

评论 (0) All

登陆 | 还没注册?