Difference of CSS and XSL

-- End Ad Box --->* Float containment
The use of style sheet languages have opened new* Lack of multiple backgrounds per element
possibilities and opportunities for web designers in* Lack control of Element Shapes
terms of freedom in designing and maintainability of* Lack of Variables
web sites. Currently, there are two kinds of style* Lack of column declaration
sheet languages used by many web designers today.* Cannot explicitly declare new scope independently
These are cascading style sheet (CSS) and extensibleof position
stylesheet language (XSL). While they are both called* Poor Layout Controls for Flexible Layouts
stylesheet languages, they have very differentEXTENSIBLE STYLESHEET LANGUAGE or XSL
purposes and ways of going about their tasks.XSL has evolved drastically from its initial design into
CASCADING STYLE SHEET or CSSsomething very different from its original purpose.
CSS was designed for the purpose of styling HTMLAccording to Web design Philippines companies, the
and XML, including XHTML document. It uses aoriginal idea for XSL was to create an XML-based
special, non-XML syntax for defining the stylingstyling language directed towards paged display
information for the various elements of themedia. The mechanism they used to accomplish this
document that it styles. As of its version 2.1, CSStask was to divide the process into two distinct
has been considered to be the best style sheetsteps. First, the XML document would be
language used for styling documents that are to betransformed into an intermediate form. The process
shown on "screen media". According to Web designfor performing this transformation would be
Philippines companies, Screen media is a term usedgoverned by the XSL stylesheet, as defined by the
when a media is displayed as a single page (possiblyXSL specification. The result of this transformation
with hyperlinks) that has a fixed horizontal width butwould be an XML document in an intermediate
a virtually unlimited vertical height. This works inlanguage, known as XSL-FO (also defined by the XSL
contrast with the term "paged media" which hasspecification).
multiple pages, each with specific fixed horizontal andHowever, in the process of designing the
vertical dimensions. Styling paged media involves atransformation step, it was realized that a generic
variety of complexities that screen media does not.XML transformation language would be useful for
Because CSS is designed mainly for screen media,more than merely creating a presentation of an XML
web designers found CSS lacking in terms pageddocument. As such, a new working group was split
facilitation. But when CSS 3.0 was released, thisoff from the XSL working group, and the XSL
constraint was lifted by providing new features thatTransformations (XSLT) language became something
allowed CSS to more adequately style documents forthat was considered separate from the styling
paged display.information of the XSL-FO document. Even that split
Advantages of Using CSSwas expanded when XPath became its own separate
Flexibilityspecification, though still strongly tied to XSLT.
By combining CSS with the functionality of a ContentAdvantage Over CSS
Management System, a considerable amount of* The combination of XSLT and XSL-FO creates a
flexibility can be programmed into content submissionpowerful styling language, though much more
forms. This allows a contributor, who may not becomplex than CSS.
familiar or able to understand or edit CSS or HTML* XSLT is a Turing complete language, while CSS is
code to select the layout of an article or other pagenot; this demonstrates a degree of power and
they are submitting on-the-fly, in the same form.flexibility not found in CSS.
Efficiency* XSLT is capable of creating content, such as
A stylesheet will usually be stored in the browserautomatically creating a table of contents just from
cache, and can therefore be used on multiple pageschapters in a book, or removing/selecting content,
without being reloaded, increasing download speedssuch as only generating a glossary from a book.
and reducing data transfer over a network.* XSLT version 1.0 with the EXSLT extensions, or
ConsistencyXSLT version 2.0 is capable of generating multiple
When CSS is used effectively, in terms of inheritancedocuments as well, such as dividing the chapters in a
and "cascading," a global stylesheet can be used tobook into their own individual pages. By contrast, a
affect and style elements site-wide. If the situationCSS can only selectively remove content by not
arises that the styling of the elements should need todisplaying it.
be changed or adjusted, these changes can be made* XSL-FO is unlike CSS in that the XSL-FO document
easily, simply by editing a few rules in the globalstands alone. CSS modifies a document that attached
stylesheet. Before CSS, this sort of maintenance wasto it, while the XSL-FO document contains all of the
more difficult, expensive and time-consuming.content to be presented in a purely presentational
Simple Page Editingformat.
With a simple change of one line, a different* For richly specified paged media, such complexity is
stylesheet can be used for the same page. This hasultimately required in order to be able to solve
advantages for accessibility, as well as providing thevarious typesetting problems which is where XSL-FO
ability to tailor a page or site to different targetis used.
devices. Furthermore, devices not able to understandNote: According to Web design Philippines specialist,
the styling will still display the content.XSL-FO does not specify the pages themselves. The
LimitationXSL-FO document must be passed through an
Though CSS is a popular style sheet languageXSL-FO processor utility that generates the final
currently used today, there are several limitation thatpaged media, much like HTML+CSS must pass
professional web designers have cited by using purethrough a web browser to be displayed in its
CSS web design. These are:formatted state.
* Inconsistent browser supportDisadvantage of XSL
* Selectors are unable to ascend* The complexity of XSL-FO is a problem, largely
* One block declaration cannot explicitly inherit frombecause implementing an FO processor is very
anotherdifficult.
* Vertical control limitations* CSS implementations in web browsers are still not
* Absence of expressionsentirely compatible with one another, and it is much
* Lack of orthogonalitysimpler than writing an FO processor.
* Margin collapsing