Difference of CSS and XSL

Marikina City, Philippines (PressExposure) April 21, 2009 -- The use of style sheet languages have opened new possibilities and opportunities for web designers in terms of freedom in designing and maintainability of web sites. Currently, there are two kinds of style sheet languages used by many web designers today. These are cascading style sheet (CSS) and extensible stylesheet language (XSL). While they are both called stylesheet languages, they have very different purposes and ways of going about their tasks.


CSS was designed for the purpose of styling HTML and XML, including XHTML document. It uses a special, non-XML syntax for defining the styling information for the various elements of the document that it styles. As of its version 2.1, CSS has been considered to be the best style sheet language used for styling documents that are to be shown on "screen media". According to Web design Philippines companies, Screen media is a term used when a media is displayed as a single page (possibly with hyperlinks) that has a fixed horizontal width but a virtually unlimited vertical height. This works in contrast with the term "paged media" which has multiple pages, each with specific fixed horizontal and vertical dimensions. Styling paged media involves a variety of complexities that screen media does not. Because CSS is designed mainly for screen media, web designers found CSS lacking in terms paged facilitation. But when CSS 3.0 was released, this constraint was lifted by providing new features that allowed CSS to more adequately style documents for paged display.

Advantages of Using CSS

Flexibility By combining CSS with the functionality of a Content Management System, a considerable amount of flexibility can be programmed into content submission forms. This allows a contributor, who may not be familiar or able to understand or edit CSS or HTML code to select the layout of an article or other page they are submitting on-the-fly, in the same form.

Efficiency A stylesheet will usually be stored in the browser cache, and can therefore be used on multiple pages without being reloaded, increasing download speeds and reducing data transfer over a network.

Consistency When CSS is used effectively, in terms of inheritance and "cascading," a global stylesheet can be used to affect and style elements site-wide. If the situation arises that the styling of the elements should need to be changed or adjusted, these changes can be made easily, simply by editing a few rules in the global stylesheet. Before CSS, this sort of maintenance was more difficult, expensive and time-consuming.

Simple Page Editing With a simple change of one line, a different stylesheet can be used for the same page. This has advantages for accessibility, as well as providing the ability to tailor a page or site to different target devices. Furthermore, devices not able to understand the styling will still display the content.


Though CSS is a popular style sheet language currently used today, there are several limitation that professional web designers have cited by using pure CSS web design. These are:

* Inconsistent browser support

* Selectors are unable to ascend

* One block declaration cannot explicitly inherit from another

* Vertical control limitations

* Absence of expressions

* Lack of orthogonality

* Margin collapsing

* Float containment

* Lack of multiple backgrounds per element

* Lack control of Element Shapes

* Lack of Variables

* Lack of column declaration

* Cannot explicitly declare new scope independently of position

* Poor Layout Controls for Flexible Layouts


XSL has evolved drastically from its initial design into something very different from its original purpose. According to Web design Philippines companies, the original idea for XSL was to create an XML-based styling language directed towards 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.

Advantage Over CSS

* 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.

* 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 attached to it, while the XSL-FO document contains all of the content to be presented in a purely presentational format.

* For richly specified paged media, such complexity is ultimately required in order to be able to solve various typesetting problems which is where XSL-FO is used.

Note: According to Web design Philippines specialist, XSL-FO 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.

Disadvantage of XSL

* 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 than writing an FO processor.

About Myoptimind

Margarette Mcbride is a copywriter of Optimind Web Design and SEO, a web design and seo company in the Philippines. Optimind specializes in building and promoting websites that are designed for conversion..

Press Release Source: http://PressExposure.com/PR/Myoptimind.html

Press Release Submitted On: April 20, 2009 at 9:32 pm
This article has been viewed 24349 time(s).