Comparison of stylesheet languages
Comparison of stylesheet languages
Main page

Comparison of stylesheet languages

logo
Community Hub0 subscribers
What are your thoughts?
Be the first to start a discussion here.
Be the first to start a discussion here.
Comparison of stylesheet languages

In computing, 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.

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.

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.

See all
User Avatar
No comments yet.