ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> xml-dev
xml-dev
[xml-dev] XSLT vs. CSS (Re: Indexing)
by Michael Day other posts by this author
Jul 1 2003 8:54AM messages near this date
Re: [xml-dev] Allowed PEReference usages | Re: [xml-dev] XSLT vs. CSS (Re: Indexing)
>  | This will allow you to convert books written in DocBook XML into PDF files
>  | or PostScript output, without using XSLT or XSL-FO.
>  
>  I'm not sure I see why that's a particular benefit, but ok :-)

Simon St. Laurent summed it up well on his O'Reilly blog:

    While it's certainly possible to tweak [XSLT] stylesheets to render a 
    particular document, I have to admit that I really miss the cascade of 
    CSS and its much easier element-by-element tweaking capabilities. 

    There are best practices for creating tweakable (well, modularized) 
    XSLT stylesheets, but you're much more at the mercy of the creator of 
    the stylesheet with which you're interacting.

    -- http://www.oreillynet.com/pub/wlg/3363

The cascading approach of CSS makes it easier to customise the formatting
of languages like DocBook that have large, complex default style sheets.

For example, if I wish to have an indent on paragraphs in my document, I 
need only add the following rule to my user style sheet:

    para { text-indent: 5mm }

However, the XSLT based approach is more complicated. I could create a
template for para, but then that would override *all* of the default
styling for paragraphs, which is not what I want. The lack of additive,
cascading templates in XSLT means that I would need a detailed knowledge
of the structure of the default style sheets in order to customise them
effectively, whereas CSS allows me to concentrate on the structure of my
documents instead.

For this reason I believe that CSS is a more effective approach for
styling XML documents, while XSLT is best used for more general
transformation tasks, such as generating documents and reports from
"data-oriented" XML, or migrating from one vocabulary to another.

Best regards,

Michael Day

(I've copied this message to xml-dev, as it seems to be a more suitable
list for this kind of discussion than docbook-apps).

-- 
YesLogic Prince prints XML!
http://yeslogic.com





-----------------------------------------------------------------
The xml-dev list is sponsored by XML.org <http://www.xml.org> , an
initiative of OASIS <http://www.oasis-open.org> 

The list archives are at http://lists.xml.org/archives/xml-dev/

To subscribe or unsubscribe from this list use the subscription
manager: <http://lists.xml.org/ob/adm.pl> 
Thread:
Michael Day
Norman Walsh
Mitch Amiano
Michael Day
Thomas B. Passin
Dave Pawson
Simon St.Laurent
Dave Pawson
Simon St.Laurent
Eric van der Vlist
Didier PH Martin
Simon St.Laurent
Mitch Amiano
Didier PH Martin
Michael Kay
Dave Pawson
Simon St.Laurent
Simon St.Laurent
Thomas B. Passin
Simon St.Laurent
Thomas B. Passin
Simon St.Laurent

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved