Why does W3C recommend two different style languages? Which one should you use? Basically, the rule can be summarized very succinctly:
Use CSS when you can, use XSL when you must.
The reason is that CSS is much easier to use, easier to learn, thus easier to maintain and cheaper. There are WYSIWYG editors for CSS and in general there are more tools for CSS than for XSL. But CSS's simplicity means it has its limitations. Some things you cannot do with CSS, or with CSS alone. Then you need XSL, or at least the transformation part of XSL.
So what are the things you use XSL for? In general everything that needs transformations. For example, if you have a list and want it displayed in lexicographical order, or if words have to be replaced by other words, or if empty elements have to be replaced by text. CSS can do some text generation, but only for generating small things, such as numbers of section headers.
Created 22 July 1999.
Last updated Sat 03 Dec 2016 06:20:42 AM UTC