Schema 介绍

来源:互联网 发布:mac口红价位 编辑:程序博客网 时间:2024/05/01 06:53

XML Schema is an XML-based alternative to DTD.
XML Schema是以XML语言为基础的,它用于可替代DTD。

An XML schema describes the structure of an XML document.
一份XML schema文件描述了XML文档的结构。

The XML Schema language is also referred to as XML Schema Definition (XSD).
XML Schema语言也被称为XML Schema Definition (XSD)(XML Schema定义).


What You Should Already Know
你应该已经掌握的知识

Before you continue you should have a basic understanding of the following:
在继续之前你应对以下内容有基本了解:

  • HTML / XHTML
  • XML and XML Namespaces
    XML 和 XML 名称空间
  • A basic understanding of DTD
    对DTD有基本的了解

If you want to study these subjects first, find the tutorials on our Home page.
如果你想先学这些内容,请看我们主页上的的学习教程


What is an XML Schema?
什么是XML Schema?

The purpose of an XML Schema is to define the legal building blocks of an XML document, just like a DTD.
XML Schema的作用是定义一份XML文档的合法组件群,就像DTD的作用一样

An XML Schema:
一份XML Schema

  • defines elements that can appear in a document
    定义了可以出现在文档里的元素
  • defines attributes that can appear in a document
    定义了可以出现在文档里的属性
  • defines which elements are child elements
    定义了哪些元素是子元素
  • defines the order of child elements
    定义了子元素的顺序
  • defines the number of child elements
    定义了子元素的数量
  • defines whether an element is empty or can include text
    定义了一个元素应是否能包含文本,或应该是空的
  • defines data types for elements and attributes
    定义了元素和属性的数据类型
  • defines default and fixed values for elements and attributes
    定义了元素和属性的默认值和固定值

XML Schemas are the Successors of DTDs
XML Schema 是DTD的“接任者”

We think that very soon XML Schemas will be used in most Web applications as a replacement for DTDs. Here are some reasons:
我们认为XML Schema很快就会替代DTD在大多数的网络应用程序中被广泛使用。

  • XML Schemas are extensible to future additions
    XML Schema针对将来的额外内容是可扩展的
  • XML Schemas are richer and more powerful than DTDs
    XML Schema内容比DTD丰富,作用也更大
  • XML Schemas are written in XML 
    XML Schema是以XML语言编写而成的
  • XML Schemas support data types
    XML Schema支持数据类型
  • XML Schemas support namespaces 
    XML Schema支持名称空间(namespaces)

XML Schema is a W3C Standard
XML Schema是W3C定义的标准

XML Schema became a W3C Recommendation 02. May 2001.
XML Schema于2001年5月2日成为W3C推荐使用的标准

You can read more about the XML Schema standard in our W3C tutorial.
在W3C 教程中你能阅读到更多关于XML Schema标
 

原创粉丝点击