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

Schema (XSD)
XSD 逻辑值数据类型
XML Schema总结
XML Schema 参考
XSD 验证

Schema (XSD) 中的 XML Schema notation 元素


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

Definition and Usage
定义和用法

The notation element describes the format of non-XML data within an XML document.
notation元素的作用是:描述一个XML文档中的非XML数据格式。

Element Information
元素信息

  • Parent elements: schema
    父类元素:schema

Syntax
语法

<notation
id=ID
name=NCName
public=anyURI
system=anyURI
any attributes
>
(annotation?)
</notation>

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

属性 描述
id Optional. Specifies a unique ID for the element
可选参数。为元素指定一个独立的ID
name Required. Specifies a name for the element
必要参数。为元素指定一个名称
public

Required. Specifies a URI corresponding to the public identifier
必要参数。指定一个与public[公共]确认器相对应的URI

system

Optional. Specifies a URI corresponding to the system identifier
可选参数。指定一个与system[系统]确认器相对应的URI

any attributes Optional. Specifies any other attributes with non-schema namespace
可选参数。指定其它的属性(这些属性无schema命名空间)

Example 1
案例1

The following example shows a gif and a jpeg notation using a viewer application, view.exe:
下面的案例通过使用“view.exe”应用程序展示了一个gif注释和一个jpeg注释:

<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:notation name="gif" public="image/gif" system="view.exe"/>
<xs:notation name="jpeg" public="image/jpeg" system="view.exe"/>
<xs:element name="image"> <xs:complexType> <xs:simpleContent> <xs:attribute name="type"> <xs:simpleType> <xs:restriction base="xs:NOTATION"> <xs:enumeration value="gif"/> <xs:enumeration value="jpeg"/> <xs:restriction> </xs:simpleType> </xs:attribute> </xs:simpleContent> </xs:complexType>
</xs:element>
</xs:schema>

可以将文档中的 "image" 元素看成下面的形式:

<image type="gif"></image>

评论 (0) All

登陆 | 还没注册?