Comparing XSL and CSS

Although I've already described some ways in which XSL and CSS differ as style sheet technologies, it's worth going through a more thorough comparison of them. More importantly, I want to point out some reasons why you might choose one technology over the other. The technologies are just similar enough that it can be difficult to determine when to use one or the other. Fortunately, the current state of browser support (or lack thereof) for CSS and XSL makes this a relatively straightforward decision.

There are two key differences between XSL and CSS, both of which I alluded to earlier in the chapter:

  • CSS can be used to style HTML documents, while XSL cannot.

  • XSL can be used to transform XML documents, while CSS cannot.

Get XML Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.