Web - Amazon

We provide Linux to the World


We support WINRAR [What is this] - [Download .exe file(s) for Windows]

CLASSICISTRANIERI HOME PAGE - YOUTUBE CHANNEL
SITEMAP
Audiobooks by Valerio Di Stefano: Single Download - Complete Download [TAR] [WIM] [ZIP] [RAR] - Alphabetical Download  [TAR] [WIM] [ZIP] [RAR] - Download Instructions

Make a donation: IBAN: IT36M0708677020000000008016 - BIC/SWIFT:  ICRAITRRU60 - VALERIO DI STEFANO or
Privacy Policy Cookie Policy Terms and Conditions
XSLT - Wikipedia

XSLT

维基百科,自由的百科全书

Image:XSLTprocessing.PNG
XSL轉換處理程序示意圖

计算机科学中, XSLT是扩展样式表转换语言(Extensible Stylesheet Language Transformations)的简称,这是一种对XML文档进行转化的语言,XSLT中的T代表英语中的“转换”(transformation)。它是XSL(Extensible stylesheet language)规范的一部分。XSL规范的另外一部分是XSLF(F代表代表格式化对象Formatting Objects),又称XSL-FO或XSLFO。

XSLT是把XML文档转化为另一XML文档的XML转换语言。 即将源文档的所有数据或者部分数据 (利用XPath进行选择)生成另外的XML文档或者其他可直接显示或打印的文件格式(例如 HTML文件, RTF文件或者TeX文件)。在这个转换过程中具体有以下涉及:

  • 加上一些诸如HTML文档中的固定标签
  • 移动文本
  • 对文本排序

被转换的源XML文档具有树状结构。XSLT语言是声明性的语言,即XSLT程序本身只是包含了一些转换规则的文档。而这些规则可以被递归地应用到转换过程中。XSLT本身也是一份XML文档,所以它也必须遵守严格的XML规范。


XSLT处理程序会首先确定使用XSLT中的哪些规则,然后根据优先度作出相应的转换操作。

可以利用XSLT以及CSS来生成HTML文档。

下面即为一份XSLT程序示例:

<?xml version="1.0" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 ...
</xsl:stylesheet>

除了XSLT外,还有另外一种转换语言STX, 这是一种旨在提供高速的低内存消耗的转换语言。


[编辑] 示例

下面的例子来自[1]

例: 下面提供了XSLT的例子,该例利用递归实现了一个阶层计算的函数。注意xsl:function 是XSLT2.0规范的一部分,该规范目前还没有完成。

<xsl:function name="eg:fact">
  <xsl:param name="n"/>
  <xsl:choose>
    <xsl:when test="$n = 1 or $n = 0">
      <xsl:value-of select="1"/>
    </xsl:when>
    <xsl:otherwise>
      <xsl:value-of select="$n * eg:fact($n - 1)"/>
    </xsl:otherwise>
  </xsl:choose>
</xsl:function>

[编辑] 请参考


[编辑] 外部连接

Our "Network":

Project Gutenberg
https://gutenberg.classicistranieri.com

Encyclopaedia Britannica 1911
https://encyclopaediabritannica.classicistranieri.com

Librivox Audiobooks
https://librivox.classicistranieri.com

Linux Distributions
https://old.classicistranieri.com

Magnatune (MP3 Music)
https://magnatune.classicistranieri.com

Static Wikipedia (June 2008)
https://wikipedia.classicistranieri.com

Static Wikipedia (March 2008)
https://wikipedia2007.classicistranieri.com/mar2008/

Static Wikipedia (2007)
https://wikipedia2007.classicistranieri.com

Static Wikipedia (2006)
https://wikipedia2006.classicistranieri.com

Liber Liber
https://liberliber.classicistranieri.com

ZIM Files for Kiwix
https://zim.classicistranieri.com


Other Websites:

Bach - Goldberg Variations
https://www.goldbergvariations.org

Lazarillo de Tormes
https://www.lazarillodetormes.org

Madame Bovary
https://www.madamebovary.org

Il Fu Mattia Pascal
https://www.mattiapascal.it

The Voice in the Desert
https://www.thevoiceinthedesert.org

Confessione d'un amore fascista
https://www.amorefascista.it

Malinverno
https://www.malinverno.org

Debito formativo
https://www.debitoformativo.it

Adina Spire
https://www.adinaspire.com