2005年11月07日

原文地址:http://www.w3schools.com/xsl/xsl_languages.asp

中文译文:

XSL 语言

本教程从XSL开始,结束于XSLT, XPath,和 XSL-FO.

从XSL开始

XSL是EXtensible Stylesheet Language(扩展样式语言)的缩写。

当意识到需要有一种基于XML的样式表语言的时候,World Wide Web Consortium (W3C)开发了XSL语言。

CSS = HTML Style Sheets

HTML使用预定义的tag,这些tag所代表的意义是众知的。

在HTML中,<table>代表的是一个表格,浏览器知道如何显示这个表格。

向HTML元素中添加样式是很简单的事情。例如,使用CSS来告诉浏览器如何显示一种特殊的字体或颜色是非常容易的。

XSL = XML Style Sheets

XSL不使用预定义的tag, 我们可以使用任何我们想使用的tag. 这些tag的含义也不是众知的。

一个<table>元素并不一定代表一个表格,它可能是一件家具,或者别的什么东西。浏览器并不知道如何显示这个元素。

XSL描述我们应该如何显示XML文档!

XSL – 不单单是一种样式语言

XSL包含三个方面的内容:

  • XSLT - 一种对XML进行转换的语言
  • XPath – 一种对XML进行导航的语言
  • XSL-FO – 一种格式化XML的语言

    本教程讲述的是XSLT

    本教程讲述的是XSLT – 一种用于对XML进行变换的语言。

    你也可以阅读我们的XPath TutorialXSL-FO Tutorial.

    英文原文:

    XSL Languages

    prev next


    It started with XSL and ended up with XSLT, XPath, and XSL-FO.


    It Started with XSL

    XSL stands for EXtensible Stylesheet Language.

    The World Wide Web Consortium (W3C) started to develop XSL because there was a need for an XML-based Stylesheet Language.


    CSS = HTML Style Sheets

    HTML uses predefined tags and the meaning of the tags are well understood.

    The <table> element in HTML defines a table – and a browser knows how to display it.

    Adding styles to HTML elements is simple. Telling a browser to display an element in a special font or color, is easy with CSS. 


    XSL = XML Style Sheets

    XML does not use predefined tags (we can use any tag-names we like), and the meaning of these tags are not well understood.

    A <table> element could mean an HTML table, a piece of furniture, or something else – and a browser does not know how to display it.

    XSL describes how the XML document should be displayed!


    XSL – More Than a Style Sheet Language

    XSL consists of three parts:

    • XSLT – a language for transforming XML documents
    • XPath – a language for navigating in XML documents
    • XSL-FO – a language for formatting XML documents

    This Tutorial is About XSLT

    The rest of this tutorial is about XSLT – the language for transforming XML documents.

    But you can also study our XPath Tutorial and our XSL-FO Tutorial.