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

XML Schema notation 元素

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

定义和用法

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

元素信息

出现次数 无限制
父元素 schema
内容 annotation

语法

</>code

  1. <notation
  2. id=ID
  3. name=NCName
  4. public=anyURI
  5. system=anyURI
  6. any attributes
  7. >
  8. (annotation?)
  9. </notation>

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

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

实例

例子 1

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

</>code

  1. <?xml version="1.0"?>
  2. <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
  3. <xs:notation name="gif" public="image/gif" system="view.exe"/>
  4. <xs:notation name="jpeg" public="image/jpeg" system="view.exe"/>
  5. <xs:element name="image">
  6. <xs:complexType>
  7. <xs:simpleContent>
  8. <xs:attribute name="type">
  9. <xs:simpleType>
  10. <xs:restriction base="xs:NOTATION">
  11. <xs:enumeration value="gif"/>
  12. <xs:enumeration value="jpeg"/>
  13. <xs:restriction>
  14. </xs:simpleType>
  15. </xs:attribute>
  16. </xs:simpleContent>
  17. </xs:complexType>
  18. </xs:element>
  19. </xs:schema>

文档中的 "image" 元素是这样的:

</>code

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

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

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

快速入口

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

其它栏目

· 建站教程
· 365学习

业务咨询

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

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

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