計算機中英文對照專業(yè)時文選讀之十九

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

添加老師微信

備考咨詢

加我微信

摘要:ExtensibleStylesheetLanguage(XSL)(1)Markuplanguageshavebeenaroundsince1969.ThatwasthegrandfatherofHypertextMarkupLanguage(HTML),whichmakestheWebwork,andofExtensibleMarkupLanguage(XML),whichhasbecometheprimarymeansofdefining,storingandformattingdatainamul

Extensible Stylesheet Language (XSL)(1)

Markup languages have been around since 1969. That was the grandfather of Hypertext Markup Language (HTML), which makes the Web work, and of Extensible Markup Language (XML), which has become the primary means of defining, storing and formatting data in a multitude of areas, including documents, forms and databases.

At the heart of these languages is a system called tagging, where text or data is marked by indicators enclosed in angled brackets, always at the beginning (tag) and often at the end (/tag).

HTML pages use standardized, predefined tags. For example, (p) means a paragraph, (h1) means a header and (b) followed by (/b) means the enclosed text is to be bold. Web browsers interpret these tags and format the text accordingly when they display the pages on-screen.

With XML, however, programmers can make up tags, and browsers have no built-in way of knowing what the tags mean or what to do about them. Further complicating matters, we can use tags to describe data itself (content) or to give formatting instructions (how to display or arrange an element).

For instance, (table) could refer to a matrixlike arrangement of items on an HTML page, or it could signify a piece of furniture. This flexibility makes XML powerful, but it confuses the distinction between content and format.

In order to display XML documents usefully, we need a mechanism that identifies and describes the meaning of formatting tags and shows how they affect other parts of the document. Past mechanisms have included the Document Style Semantics and Specification Language, and Cascading Style Sheets. Both have now been extended and superseded by Extensible Stylesheet Language, a standard recommended by the World Wide Web Consortium (W3C) in 2001.

Extensible Stylesheet Language (XSL) is a family of languages and specifications designed for laying out and presenting XML documents and data in specified formats appropriate for the final output medium or device.

XSL provides a comprehensive model and vocabulary for writing stylesheets using XML syntax. It is used to define how to transform an XML file into a format (such as HTML) that a browser can recognize and understand.

XSL can add elements to the output file or remove or ignore existing elements. It can rearrange and sort the elements, test and make decisions about which elements to display, and a lot more.(To Be Continued)

時文選讀:可擴展版式語言( XSL)(1)

自 1969年就有了標記語言。它是超文本標記語言(HTML)和擴展標記語言(XML)的始祖,HTML成就了互聯(lián)網,而XML是在文檔、格式和數據庫等多方面定義、儲存和格式化數據的基本手段。

這些語言的核心是一個叫 “標記”的系統(tǒng),其中文本或數據被用尖括號括起來的指示符做標記??偸且浴?標記)”開始,常常以“”結束。

HTML頁面使用標準化的、預定義的標記。例如,“(p)”表示段落,“(h1)”表示標題,而“(b)”后跟“(/b)”表示括起來的文本要大寫。Web瀏覽器解釋這些標記,在屏幕上顯示文本時根據標記對文本格式化。

然而在使用 XML時,程序員可以創(chuàng)造標記,而瀏覽器沒有內在預定好的方法,知道這些標記是什么意思或者對它們做些什么。更為復雜的是,我們能用標記來表述數據本身(內容)或者給出格式化的指令(如何顯示或安排內容)。

例如, “(table)”可以指在HTML頁面上像矩陣那樣安排內容,或者強調它只是一片空白。這種靈活性使XML功能強大,但也混淆了內容與格式之間的界限。

為了有效地顯示 XML文檔,我們需要一種機制,它能識別和描述格式標記的意義,以及說明這些標記如何影響文檔的其他部分。過去的機制包括文檔風格語義和規(guī)范語言以及級聯(lián)版式?,F(xiàn)在,萬維網聯(lián)盟(W3C)在2001年推薦的標準——可擴展版式語言將這些機制擴展進來或替代了。

可擴展模版語言( XSL)是一組語言和規(guī)范,設計來以與最終輸出介質和設備相適應的指定格式編排和展現(xiàn)XML文檔。

XSL為用XML語法編寫版式提供了一個綜合的模型和詞匯表。它用來定義如何把XML文件轉換成瀏覽器能夠識別和理解的格式。

XSL 能給輸出文件增加成分或者去掉或忽略已有的成分。它也能重新安排和篩選成分,測試和決定哪些成分顯示等等。

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

軟考備考資料免費領取

去領取

!
咨詢在線老師!