Xhtml 简明教程

XHTML - Introduction

XHTML是E*X*tensible *H*yper*T*ext *M*arkup *L*anguage的首字母缩写。这是互联网发展中的下一步。XHTML 1.0是XHTML系列中的第一个文档类型。

XHTML stands for E*X*tensible *H*yper*T*ext *M*arkup *L*anguage. It is the next step in the evolution of the internet. The XHTML 1.0 is the first document type in the XHTML family.

XHTML几乎与HTML 4.01相同,只有很少的差异。这是HTML 4.01的一个更简洁、更严格的版本。如果你已经知道HTML,那么你只需要稍加注意就可以学习这个最新的HTML版本。

XHTML is almost identical to HTML 4.01 with only few differences. This is a cleaner and stricter version of HTML 4.01. If you already know HTML, then you need to give little attention to learn this latest version of HTML.

XHTML是由万维网联盟(W3C)开发的,为了帮助网络开发者实现从HTML到XML的过渡。通过现在迁移到XHTML,网络开发者可以利用它的所有好处进入XML世界,同时仍然相信内容的向后和未来兼容性。

XHTML was developed by World Wide Web Consortium (W3C) to help web developers make the transition from HTML to XML. By migrating to XHTML today, web developers can enter the XML world with all of its benefits, while still remaining confident in the backward and future compatibility of the content.

Why Use XHTML?

将他们的内容迁移到XHTML 1.0的开发者们获得了以下好处:

Developers who migrate their content to XHTML 1.0 get the following benefits −

  1. XHTML documents are XML conforming as they are readily viewed, edited, and validated with standard XML tools.

  2. XHTML documents can be written to operate better than they did before in existing browsers as well as in new browsers.

  3. XHTML documents can utilize applications such as scripts and applets that rely upon either the HTML Document Object Model or the XML Document Object Model.

  4. XHTML gives you a more consistent, well-structured format so that your webpages can be easily parsed and processed by present and future web browsers.

  5. You can easily maintain, edit, convert and format your document in the long run.

  6. Since XHTML is an official standard of the W3C, your website becomes more compatible with many browsers and it is rendered more accurately.

  7. XHTML combines strength of HTML and XML. Also, XHTML pages can be rendered by all XML enabled browsers.

  8. XHTML defines quality standard for your webpages and if you follow that, then your web pages are counted as quality web pages. The W3C certifies those pages with their quality stamp.

网络开发者和网络浏览器设计师不断地发现新的方法通过新的标记语言表达他们的想法。在XML中,引入新元素或额外的元素属性相对容易。XHTML系列被设计为通过XHTML模块和开发新的符合XHTML的模块的技术来适应这些扩展。这些模块允许在开发内容和设计新的用户代理时组合现有和新的功能。

Web developers and web browser designers are constantly discovering new ways to express their ideas through new markup languages. In XML, it is relatively easy to introduce new elements or additional element attributes. The XHTML family is designed to accommodate these extensions through XHTML modules and techniques for developing new XHTML-conforming modules. These modules permit the combination of existing and new features at the time of developing content and designing new user agents.

Basic Understanding

在我们继续之前,让我们快速浏览一下什么是HTML、XML和SGML。

Before we proceed further, let us have a quick view on what are HTML, XML, and SGML.

What is SGML?

这是一个符合国际标准ISO 8879的*S*tandard *G*eneralized *M*arkup *L*anguage (SGML)应用程序。HTML被广泛认为是万维网的标准出版语言。

This is *S*tandard *G*eneralized *M*arkup *L*anguage (SGML) application conforming to International Standard ISO 8879. HTML is widely regarded as the standard publishing language of the World Wide Web.

这是一种用于描述标记语言的语言,特别是那些用于电子文档交换、文档管理和文档发布的语言。HTML是SGML中定义的语言的一个例子。

This is a language for describing markup languages, particularly those used in electronic document exchange, document management, and document publishing. HTML is an example of a language defined in SGML.

What is XML?

XML代表E*X*tensible *M*arkup *L*anguage。XML是一种标记语言,很像HTML,并且它被设计用来描述数据。XML标签不是预先定义的。你必须根据自己的需要定义自己的标签。

XML stands for E*X*tensible *M*arkup *L*anguage. XML is a markup language much like HTML and it was designed to describe data. XML tags are not predefined. You must define your own tags according to your needs.