XML schema 学习笔记

XML Schema

2008-10-26

XML schema

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

描述语言

XML Schema描述语言有:DTD, XML Schema等。

DTDXML规范所固有的,功能相对有限,除了用来描述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的步骤:

  1. 创建Simple data type;

  2. 创建Complex data types;

  3. 创建elements, 及相关的Attributes;

  4. 创建elements 之间的关系,如:包含,顺序,可选等;








  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值