专注在线职业教育23年
下载APP
小程序
希赛网小程序
导航

计算机中英文对照专业时文选读之十九

责编:dapengpeng 2004-12-31

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成就了互联网,而XML是在文档、格式和数据库等多方面定义、储存和格式化数据的基本手段。

这些语言的核心是一个叫 “标记”的系统,其中文本或数据被用尖括号括起来的指示符做标记。总是以“(标记)”开始,常常以“”结束。

HTML页面使用标准化的、预定义的标记。例如,“(p)”表示段落,“(h1)”表示标题,而“(b)”后跟“(/b)”表示括起来的文本要大写。Web浏览器解释这些标记,在屏幕上显示文本时根据标记对文本格式化。

然而在使用 XML时,程序员可以创造标记,而浏览器没有内在预定好的方法,知道这些标记是什么意思或者对它们做些什么。更为复杂的是,我们能用标记来表述数据本身(内容)或者给出格式化的指令(如何显示或安排内容)。

例如, “(table)”可以指在HTML页面上像矩阵那样安排内容,或者强调它只是一片空白。这种灵活性使XML功能强大,但也混淆了内容与格式之间的界限。

为了有效地显示 XML文档,我们需要一种机制,它能识别和描述格式标记的意义,以及说明这些标记如何影响文档的其他部分。过去的机制包括文档风格语义和规范语言以及级联版式。现在,万维网联盟(W3C)在2001年推荐的标准——可扩展版式语言将这些机制扩展进来或替代了。

可扩展模版语言( XSL)是一组语言和规范,设计来以与最终输出介质和设备相适应的指定格式编排和展现XML文档。

XSL为用XML语法编写版式提供了一个综合的模型和词汇表。它用来定义如何把XML文件转换成浏览器能够识别和理解的格式。

XSL 能给输出文件增加成分或者去掉或忽略已有的成分。它也能重新安排和筛选成分,测试和决定哪些成分显示等等。

更多资料
更多课程
更多真题
温馨提示:因考试政策、内容不断变化与调整,本网站提供的以上信息仅供参考,如有异议,请考生以权威部门公布的内容为准!
相关阅读
查看更多

加群交流

公众号

客服咨询

考试资料

每日一练