|
|
 |
Article:
 |
 |
Printing XML: Why CSS Is Better than XSL
|
| Subject: |
I'd prefer to use CSS but often the power of XSLT is required |
| Date: |
2005-01-20 10:06:09 |
| From: |
dmini |
|
|
|
Very interesting article, thank you. CSS syntax is indeed very concise and clear, but as the author has noted CSS' only purpose is formatting, and to me it means that input XML document has to be structured similar to desired output. XSLT, on the other hand can be used to format XML documents of arbitrary structure.
If this limitation can be dismissed because input is in fact suitable for CSS formatting, I'd definitely choose CSS over XSLT, provided there are tools that can produce output in desired format (in many cases, PDF). |
- I'd prefer to use CSS but often the power of XSLT is required
2005-01-20 11:08:24 BruceE
[Reply]
Regarding the power of using XSL to change the structure (that CSS can't address). Why wouldn't you then use XSL to change the structure then use CSS to transform for printing? Best of both worlds, orthogonal uses.
The power that is described in this article with CSS is that a lot of the formatting issues with printing have been factored into the available constructs in CSS. This moves the complexity from the CSS sheet into the definition of the available CSS keywords (and thus into the redering engines). That is good because that is common to all (most) printing tasks.
There is no reason why that couldn't have been done more with XML-FO (e.g. make page sizes predefined selections instead of actual sizes in length usings). Further, the problem appears to be that XML-FO is too low-level; an addition layer is perhaps needed. It would be analogous to adding the LaTeX macros to TeX. The the XSL for a document might be much smaller and not far off from the CSS examples.
|
 |
Sponsored By:
|