当前位置: 首页 > 网络学院 > XML相关教程 > XML > XML 介绍

XML
XML DHTML行为
XML 相关技术
XML 编辑器
XML 摘要
XML 实例
XML字符编码
xml 文档树
IE和火狐读取XML方法比较

XML 介绍


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-01   浏览: 1069 ::
收藏到网摘: n/a

XML was designed to describe data and to focus on what data is.
XML用于描述数据,侧重于数据本身(如:数据类型和数据结构)的定义。

HTML was designed to display data and to focus on how data looks.
HTML用于显示数据,侧重于数据的显示形式。


What You Should Already Know
你应具备的知识

Before you continue you should have a basic understanding of the following:
在继续下面的学习前,你必须对以下内容有基本认识:

  • HTML / XHTML
  • JavaScript 或 VBScript

If you want to study these subjects first, find the tutorials on our Home page.
如果你想先学习上述内容,请参照知识库的教程。


What is XML?
什么是XML?

  • XML stands for EXtensible Markup Language
    XML代表EXtensible Markup Language(可扩展标记语言)
  • XML is a markup language much like HTML
    XML是一种标记语言,这点与HTML非常相似
  • XML was designed to describe data
    XML是用于描述数据的
  • XML tags are not predefined. You must define your own tags
    XML标签不像HTML那样,是预先定义好的,你必须定义自己设定的标签
  • XML uses a Document Type Definition (DTD) or an XML Schema to describe the data
    XML使用DTD(Document Type Definition:文档类型描述)或XMLSchema来描述数据
  • XML with a DTD or XML Schema is designed to be self-descriptive
    带有DTD或XMLSchema的XML具有“自我描述”的特点。
  • XML is a W3C Recommendation
    XML是W3C推荐使用的标准

XML is a W3C Recommendation
XML是W3C推荐使用的标准

The Extensible Markup Language (XML) became a W3C Recommendation 10. February 1998.
1998年2月10日,扩展标记语言(XML)成为W3C推荐使用的标准。

You can read more about XML standards in our W3C tutorial.
W3C教程中你能看到更多关于XML的标准。


The Main Difference Between XML and HTML
XML和HTML的主要差别

XML was designed to carry data
XML用于承载数据

XML is not a replacement for HTML
XML并不能作为HTML的替代品

XML and HTML were designed with different goals
XML和HTML定义的目的是不同的

XML was designed to describe data and to focus on what data is
XML用于描述数据,侧重于数据本身(如:数据类型和数据结构)的定义

HTML was designed to display data and to focus on how data looks
HTML用于显示数据,侧重于数据的显示形式

HTML is about displaying information, while XML is about describing information
HTML侧重于显示信息,而XML则侧重于描述信息 


XML Does not DO Anything
XML是“不干任何事情的”

XML was not designed to DO anything.
XML是不用于“干事”的。

Maybe it is a little hard to understand, but XML does not DO anything. XML was created to structure, store and to send information.
可能这么解释XML有点难以理解,但XML确实不干任何事;XML只是用来架构信息、储存信息以及发送信息的。

The following example is a note to Tove from Jani, stored as XML:
下面的例子是以XML形式书写的一张 Jani  给 Tove 的便条:

<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>

<body>Don't forget me this weekend!</body>
</note>

The note has a header and a message body. It also has sender and receiver information. But still, this XML document does not DO anything. It is just pure information wrapped in XML tags. Someone must write a piece of software to send, receive or display it.
这份便条包含了标题和信息主体,还包含信息发送者和接受者的相关信息。但在这里,我们还是要强调的是:XML文件并未作任何处理。它只是将信息嵌套在XML标签里。别人必须书写一个指令才能发送、接受或显示它。 


XML is Free and Extensible
XML是免费的可自由扩展的 

XML tags are not predefined. You must "invent" your own tags.
XML标签不是预先定义的,你必须得自己“创造”标签。

The tags used to mark up HTML documents and the structure of HTML documents are predefined. The author of HTML documents can only use tags that are defined in the HTML standard (like <p>, <h1>, etc.).
用于标记HTML文档和HTML文档结构的标签是预先定义好的,HTML文档的文档作者只能使用HTML中预先定义好的标签对文档进行编辑(像<p>, <h1>,等等)。

XML allows the author to define his own tags and his own document structure.
XML允许编者自定义标签和文档结构。

The tags in the example above (like <to> and <from>) are not defined in any XML standard. These tags are "invented" by the author of the XML document.
上述例子中使用的标签(如 <to> 和 <from>)并未在任何XML标准中定义,这些标签是XML文档作者自己“创造”的。


XML is a Complement to HTML
XML是HTML的补充

XML is not a replacement for HTML
XML不能当作HTML的替代品。

It is important to understand that XML is not a replacement for HTML. In future Web development it is most likely that XML will be used to describe the data, while HTML will be used to format and display the same data.
这里有一点非常重要:XML不是HTML的替代品。即使在将来的互联网中,XML也很可能只用于定义数据,而HTML则用于格式化数据和显示数据。

My best description of XML is this: XML is a cross-platform, software and hardware independent tool for transmitting information.
我们对XML最好的解释是:XML是跨平台的,它是一种独立于软硬件的数据传输工具。


XML in Future Web Development
XML在未来网络中的发展

XML is going to be everywhere
XML发展到后面将会随处可见。

We have been participating in XML development since its creation. It has been amazing to see how quickly the XML standard has been developed and how quickly a large number of software vendors have adopted the standard.
自XML诞生以来,我们就已经参与到它的发展过程之中。令人难以想象的是:XML标准的发展是如此迅速,并很快被大批的软件商所接纳和使用。

We strongly believe that XML will be as important to the future of the Web as HTML has been to the foundation of the Web and that XML will be the most common tool for all data manipulation and data transmission.
我们坚信,XML对未来网络的重要性决不亚于当初HTML对网络架构的重要性;并且,XML将成为数据处理和数据传输中最普遍使用的工具。 


XML Joke
关于XML的笑话 

Question: When should I use XML?
问:我该什么时候使用XML呢?

Answer: When you need a buzzword in your resume.
答:当你想在履历表中强调某些词的时候。

评论 (4) 1 All

登陆 | 还没注册?