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

軟考 責(zé)任編輯: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)

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

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

這些語言的核心是一個(gè)叫 “標(biāo)記”的系統(tǒng),其中文本或數(shù)據(jù)被用尖括號括起來的指示符做標(biāo)記。總是以“(標(biāo)記)”開始,常常以“”結(jié)束。

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

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

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

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

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

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

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

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

軟考備考資料免費(fèi)領(lǐng)取

去領(lǐng)取

!
咨詢在線老師!