您的位置:首页 > 其它

XML schema 学习笔记

2008-10-26 04:01 260 查看
XML Schema
2008-10-26

XML schema

XML schema 用来描述XML文档的类型,是对文档更高层的抽象。

描述语言

XML Schema描述语言有:DTD,
XML Schema等。
DTD是XML规范所固有的,功能相对有限,除了用来描述schema,还可以有其它的用途。

什么是
XML Schema?

是XML
schema语言之一,由W3C
发布。

XML Schema 定义了XML文档必须遵循的规则。这些规则通过
data model 来描述,包括:

the vocabulary (element and
attribute names)

the content model (relationships
and structure)

the data types.

XML Schema 的数据模型依赖于具体的data
types。通过验证的XML文档将生成post-validation
infoset,这使得XML文档有了类型信息,从而可以将文档当做对象看待,使用OOP技术来处理XML文档。这对XML文档处理软件的开发非常有用。

验证(Validation)

检查XML文档是否遵循schema的过程,称之为验证。
验证有以下几个级别:

The validation of the markup --
controlling the structure of a document.

The validation of the content of
individual leaf nodes (datatyping)

The validation of integrity, i.e.
of the links between nodes within a document or between documents.

Any other tests (often called
"business rules").

目前schema对前两种验证支持的比较好,对link
验证的支持很弱。

工具

XMLSpy

由altova
公司出品;

使用XMLSpy创建schema的步骤:

创建Simple
data type;

创建Complex
data types;

创建elements,
及相关的Attributes;

创建elements
之间的关系,如:包含,顺序,可选等;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: