ArticleslgStudy

computer science

Comparison of stylesheet languages

Comparison of stylesheet languages is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Comparison of stylesheet languages rather than just read about it. In short: 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.

Key takeaways

  • Comparison of stylesheet languages belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Comparison of stylesheet languages to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Comparison of stylesheet languages from memory before moving on to harder problems.

Reference excerpt

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.

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 Extensible Stylesheet Language XSL Transformations XSL Formatting Objects XPath

External links Why is the W3 producing 2 Style Sheet Languages? W article Using CSS and XSL together W3 article Printing XML Why CSS is better than XSL. Article on SLT for transformations and CSS for web presentation MS XML Team Blog CSS vs. XSL

Worked examples

Example 1 — a first encounter with Comparison of stylesheet languages

Start with the simplest possible case. Write down what Comparison of stylesheet languages claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Comparison of stylesheet languages before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Comparison of stylesheet languages ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Comparison of stylesheet languages

In research
Comparison of stylesheet languages appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Comparison of stylesheet languages in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Comparison of stylesheet languages is common in secondary-school and first-year university syllabi. It links to neighbouring topics Computing comparisons, Stylesheet languages, so understanding it makes those chapters shorter.
In everyday life
Look for Comparison of stylesheet languages outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Comparison of stylesheet languages” →

How to study Comparison of stylesheet languages in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Comparison of stylesheet languages means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Comparison of stylesheet languages out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Comparison of stylesheet languages in simple terms?

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.

Why does Comparison of stylesheet languages matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Comparison of stylesheet languages?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Comparison of stylesheet languages.

Tags

  • Computing comparisons
  • Stylesheet languages

Keep exploring