纷繁的 XML Schema 技术:基于规则的语言[1]

[入库:2005年8月18日] [更新:2007年3月25日]

本文简介:选择自 taowen2002 的 blog

本文是xml europe 2002会议上的一次tutorial的记录。详细讲述了各种用来定义xml的结构应该是这样的schema语言的特点以及用处。我将文章译成了三部分,这是第一部分,讲述基于规则的schema如何规范xml。

1. 简介

what is a xml schema language?

什么是 xml schema 语言?

i will insist more on this point during my comparison of xml schema languages on wednesday morning, but one thing is sure: a xml schema language is probably not what you're expecting, and its main feature is not (or not always) to describe a class of xml documents but rather to act as a filter or firewall to protect applications from the wide diversity of well formed xml documents.

我将在星期三早上对各种 xml schema 语言进行比较的时候会强调更多事情,但是一件事情是肯定的:一种 xml schema 语言可能不是你所期望的,但是它的主要特性不是(或者不总是)去描述一类 xml 文档而是作为一个过滤器或者防火墙来把程序从各种各样合式的 xml 文档保护起来。

all over this tutorial we will use the following example:

整个教程我将使用这个例子:

 <?xml version="1.0"?>
<library>
<book id="_0836217462">
<isbn>
0836217462
</isbn>
<title>
being a dog is a full-time job
</title>
<author-ref id="charles-m.-schulz"/>
<character-ref id="peppermint-patty"/>
<character-ref id="snoopy"/>
<character-ref id="schroeder"/>
<character-ref id="lucy"/>
</book>
<book id="_0805033106">
<isbn>
0805033106
</isbn>
<title>
peanuts every sunday
</title>
<author-ref id="charles-m.-schulz"/>
<character-ref id="sally-brown"/>
<character-ref id="snoopy"/>
<character-ref id="linus"/>
<character-ref id="snoopy"/>
</book>
<author id="charles-m.-schulz">
<name>
charles m. schulz
</name>
<nickname>
sparky
</nickname>
<born>
1992-11-26
</born>
<dead>
2000-02-12
</dead>
</author>
<character id="peppermint-patty">
<name>
peppermint patty
</name>
<since>
1966-08-22
</since>
<qualification>
bold, brash and tomboyish
</qualification>
</character>
<character id="snoopy">
<name>
snoopy
</name>
<since>
1950-10-04
</since>
<qualification>
extroverted beagle
</qualification>
</character>
<character id="schroeder">
<name>
schroeder
</name>
<since>
1951-05-30
</since>
<qualification>
brought classical music to the peanuts strip
</qualification>
</character>
<character id="lucy">
<name>
lucy
</name>
<since>
1952-03-03
</since>
<qualification>
bossy, crabby and selfish
</qualification>
</character>
<character id="sally-brown">
<name>
sally brown
</name>
<since>
1960-08-22
</since>
<qualification>
always looks for the easy way out
</qualification>
</character>
<character id="linus">
<name>
linus
</name>
<since>
1952-09-19
</since>
<qualification>
the intellectual of the gang
</qualification>
</character>

本文关键:XML Schematron Rule XSLT
  相关方案
Google
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top