Comparison of stylesheet languages

Comparison of stylesheet languages

The two primary stylesheet languages are Cascading Style Sheets (CSS) and the Extensible Stylesheet Language (XSL). While they are both called stylesheet languages, they have very different purposes and ways of going about their tasks.

Contents

Cascading Style Sheets

CSS is designed around styling a document, structured in a markup language, HTML and XML (including XHTML and SVG) documents. It was created for that purpose. The code CSS is non-XML syntax to define the style information for the various elements of the document that it styles.

The language to structure a document (markup language) is a prelimit to CSS. A markup language, like HTML and less XUL, may define some primitive elements to style a document, for example <emphasis> to bold. CSS post styles a document to "screen media" or "paged media".

Screen media, displayed as a single page (possibly with hyperlinks), that has a fixed horizontal width but a virtually unlimited vertical height. Scrolling is often the method of choice for viewing parts of screen media. This is in contrast to "paged media", which has multiple pages, each with specific fixed horizontal and vertical dimensions. To style paged media involves a variety of complexities that screen media does not. Since CSS was designed originally for screen media, its paged facilities lacked.

CSS version 3.0 provides new features that allow CSS to more adequately style documents for paged display.

Extensible Stylesheet Language

XSL has evolved drastically from its initial design into something very different from its original purpose. The original idea for XSL was to create an XML-based styling language directed toward paged display media. The mechanism they used to accomplish this task was to divide the process into two distinct steps.

First, the XML document would be transformed into an intermediate form. The process for performing this transformation would be governed by the XSL stylesheet, as defined by the XSL specification. The result of this transformation would be an XML document in an intermediate language, known as XSL-FO (also defined by the XSL specification).

However, in the process of designing the transformation step, it was realized that a generic XML transformation language would be useful for more than merely creating a presentation of an XML document. As such, a new working group was split off from the XSL working group, and the XSL Transformations (XSLT) language became something that was considered separate from the styling information of the XSL-FO document. Even that split was expanded when XPath became its own separate specification, though still strongly tied to XSLT.

The combination of XSLT and XSL-FO creates a powerful styling language, though much more complex than CSS. XSLT is a Turing complete language, while CSS is not; this demonstrates a degree of power and flexibility not found in CSS. Additionally, XSLT is capable of creating content, such as automatically creating a table of contents just from chapters in a book, or removing/selecting content, such as only generating a glossary from a book. XSLT version 1.0 with the EXSLT extensions, or XSLT version 2.0 is capable of generating multiple documents as well, such as dividing the chapters in a book into their own individual pages. By contrast, a CSS can only selectively remove content by not displaying it.

XSL-FO is unlike CSS in that the XSL-FO document stands alone. CSS modifies a document that is attached to it, while the XSL-FO document (usually the result of the transformation by XSLT of the original document) contains all of the content to be presented in a purely presentational format. It has a wide range of specification options with regard to paged formatting and higher-quality typesetting. But it does not specify the pages themselves. The XSL-FO document must be passed through an XSL-FO processor utility that generates the final paged media, much like HTML+CSS must pass through a web browser to be displayed in its formatted state.

The complexity of XSL-FO is a problem, largely because implementing an FO processor is very difficult. CSS implementations in web browsers are still not entirely compatible with one another, and it is much simpler to write a CSS processor than an FO processor. However, for richly specified paged media, such complexity is ultimately required in order to be able to solve various typesetting problems.

See also

External links


Wikimedia Foundation. 2010.

Игры ⚽ Нужна курсовая?

Look at other dictionaries:

  • List of stylesheet languages — The following is a list of style sheet languages.tandard*Cascading Style Sheets (CSS) *Document Style Semantics and Specification Language (DSSSL) *Extensible Stylesheet Language (XSL)Non standard*JavaScript Style Sheets (JSSS) *Formatted Output… …   Wikipedia

  • Comparison of layout engines (Cascading Style Sheets) — Cascading Style Sheets CSS Animations Dynamic CSS Comparison of layout engines Comparison of stylesheet languages Internet Explorer box model bug CSS Zen Garden The Zen of CSS Design CSSTidy Style sheet Tableless web design Holy Grail (web… …   Wikipedia

  • Extensible Stylesheet Language — In computing, the Extensible Stylesheet Language (XSL), a family of transformation languages, allows one to describe how to format or transform files encoded in the XML standard. The XSL language itself uses valid XML syntax, with constructs such …   Wikipedia

  • Comparison of wiki software — The following tables compare general and technical information for a number of wiki software packages. Contents 1 General information 2 Target audience 3 Features 1 4 Features 2 …   Wikipedia

  • Comparison of layout engines (HTML) — HTML HTML and HTML5 Dynamic HTML XHTML XHTML Mobile Profile and C HTML Canvas element Character encodings Document Object Model Font family HTML editor HTML element HTML Frames HTML5 video HTML scrip …   Wikipedia

  • Comparison of e-book formats — Contents 1 Format descriptions 1.1 Amazon Kindle 1.2 Archos Diffusion 1.3 Broadband eBooks (BBeB) …   Wikipedia

  • Cascading Style Sheets — CSS redirects here. For other uses, see CSS (disambiguation). For the use of CSS on Wikipedia, see Help:Cascading style sheets. Cascading Style Sheets Filename extension .css Internet media type text/css Developed by World Wide Web Consortium …   Wikipedia

  • Dynamic Cascading Style Sheets — Cascading Style Sheets CSS Animations Dynamic CSS Comparison of layout engines Comparison of stylesheet languages Internet Explorer box model bug CSS Zen Garden The Zen of CSS Design CSSTidy Style sheet Tableless web design Holy Grail (web… …   Wikipedia

  • Style sheet language — A style sheet language is a computer language used to describe the presentation of structured documents. A structured document is a document whose sections are clearly defined and categorized (also called well formed ). A program presenting the… …   Wikipedia

  • JavaScript Style Sheets — (JSSS) was a stylesheet language technology proposed by Netscape Communications Corporation in 1996 to provide facilities for defining the presentation of webpages. It was an alternative to the Cascading Style Sheets (CSS) technology. Although… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”