×
XML Schema 教程XML Schemas 简介为什么使用 Schema?如何使用 XML SchemaSchema 元素XSD 简易元素Schema 属性Schema 限定 / FacetsSchema 复合元素Schema 复合空元素Schema 复合类型 - 仅含元素Schema 复合元素 - 仅含文本Schema 复合类型 - 混合内容Schema 指示器Schema any 元素anyAttribute 元素Schema 元素替换XML Schema 实例Schema 字符串数据类型Schema 日期/时间类型Schema 数值数据类型Schema 杂项数据类型XML 编辑器XML Schema 总结XML Schema 参考手册

XML Schema notation 元素


XML Schema 参考手册XML Schema 参考手册


定义和用法

notation 元素描述 XML 文档中非 XML 数据的格式。

元素信息

  • 父元素: schema

语法

<notation
id=ID
name=NCName
public=anyURI
system=anyURI
any attributes
>

(annotation?)

</notation>

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

属性 描述
id 可选。规定该元素的唯一的 ID。
name 必需。为元素规定名称。
public 必需。与 public 标识符相对应的 URI 引用。
system 与 system 标识符相对应的 URI 引用。
any attributes 可选。规定带有 non-schema 命名空间的任何其他属性。

实例 1

下面的例子通过使用一个查看应用程序 view.exe 来显示 gif 和 jpeg 格式的 notation:

<?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>

XML Schema 参考手册XML Schema 参考手册


分类导航

关注微信下载离线手册

bootwiki移动版 bootwiki
(群号:472910771)