計算機專業(yè)時文選讀之十

軟考 責任編輯:yangjlhnu 2004-12-31

添加老師微信

備考咨詢

加我微信

摘要:ExtensibleStylesheetLanguage(XSL)(2)ComponentsofXSLXSLisactuallyafamilyofthreetoolsproducedbytheW3C''sXSLWorkingGroup:XPath,XSLTandXSF-FO.*XPath,orXMLPathLanguage,isusedtospecifythepartsofanXMLdocumentthatwillbetransformedbyXSLTransformations(XSLT)

Extensible Stylesheet Language (XSL)(2)

Components of XSL

XSL is actually a family of three tools produced by the W3C's XSL Working Group: XPath, XSLT and XSF-FO.

* XPath, or XML Path Language, is used to specify the parts of an XML document that will be transformed by XSL Transformations (XSLT). XPath interprets an XML document as a hierarchical tree of nodes, which can include elements, attributes or text. The hierarchical tree is called the source-node tree.

* XSLT describes how to filter or convert (transform) XML documents into other types of XML documents, including XSL Formatting Object (XSL-FO) files. An XSLT stylesheet contains a set of template rules for transforming a source tree by matching a pattern against elements in the source tree. When a match is found, the rules are used to create a new node in the result tree. The result tree's structure can be completely different from that of the source tree because elements can be filtered and reordered and arbitrary structure added. An XSLT stylesheet is like a sophisticated search-and-replace routine.

* XSL-FOs are instructions that define exactly how a document will be formatted for a specific medium or device. For a document to be printed, formatting objects can include characters, blocks of text, images, tables, borders, master pages and the like.

XSL-FO specifies various layout rules (e.g., where page breaks can occur) and requirements (e.g., placement of footnotes), but the XSL-FO file itself doesn't determine exactly where each element is positioned. That' s done by a separate formatting engine that interprets the file.

XSL-FO isn't restricted to printed pages and on-screen appearance; it can also specify audio reproduction, for example. Confusingly, XSL-FO is sometimes referred to as XSL.

Why XSL?

XSL is designed for repetitive situations where documents are dynamically generated and formatted on demand, not for documents that require a creative professional to modify the layout, content and typography to get an acceptable (albeit static) result. XSL is thus an ideal fit for documents that have to be output in a variety of formats and on many different types of devices, ranging from printers and computer screens to handhelds and phones.

(The End)

時文選讀

可擴展版式語言( XSL)(2)

XSL的組成

實際上, XSL家族有三個工具,分別是由W3C的XSL工作組編制的XPath,、XSLT和XSF-FO。

* XPath,即XML通道語言,用來指定將由XSL轉換工具(XSLT)轉換的XML文檔的部分。XPath用節(jié)點的層次樹解釋XML文檔,它可以包括元素、屬性或文本。層次樹也叫做源節(jié)點樹。

* XSLT描述如何對XML文檔進行過濾或轉換成其他類型的XML文檔,包括XSL格式化對象(XSL-FO)文件。XSLT版式包含一組轉換源樹用的模板規(guī)則,它是通過將模式與源樹中的元素進行匹配來完成轉換的。如果匹配,規(guī)則就用于生成結果樹中的新節(jié)點。結果樹的結構可以與源樹完全不同,因為元素可以被過濾和重新排序,還能加入任意的結構。XSLT版式類似于復雜的搜索和替代子程序。

* XSL-FO是確切定義文檔如何為指定的介質或設備而格式化的指令。對于要打印的文檔,格式化對象可以包括字符、文本、圖像、表格、邊框、主頁等等。

XSL-FO規(guī)定各種不同的排版規(guī)則(如何處分頁)和要求(如放置腳注),但XSL-FO文件本身不確切決定每個元素的位置。那是由解釋該文件的獨立的格式化引擎完成。

XSL-FO并不僅僅局限于打印頁面和屏幕顯示,它還能重現(xiàn)聲音。令人混淆的是,XSL-FO有時也指XSL。

為什么用 XSL?

XSL 設計用于重復性的場合,其中文檔是動態(tài)生成,格式按需產(chǎn)生, XSL 不適合于需要由創(chuàng)作人員修改版式、內(nèi)容和印刷式樣等以保證結果能被接受(雖然是靜態(tài)的)的文檔。因此, XSL 非常適合必須以各種不同的格式和在多種不同設備(從打印機、計算機屏幕到手持設備和電話)上輸出的文檔。

更多資料
更多課程
更多真題
溫馨提示:因考試政策、內(nèi)容不斷變化與調整,本網(wǎng)站提供的以上信息僅供參考,如有異議,請考生以權威部門公布的內(nèi)容為準!

軟考備考資料免費領取

去領取

!
咨詢在線老師!