OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xml-dev] XSLT vs. CSS (Re: Indexing)

[ Lists Home | Date Index | Thread Index ]

[Michael Day]
>
> > I would say that your conclusion mirrors the rationale for XSLT
> >
> > "This specification defines the syntax and semantics of XSLT, which is a
> > language for transforming XML documents into other XML documents."
>
> Yes, that is why I believe that XSLT is best used for general
> transformation tasks, rather than for styling documents.
>

This whole discussion seems completely irrelevant to me.  Say you were to
author (by hand) a document to be displayed.  It is either an html document,
or an xml one that is destined to be converted into an html document by an
xslt transformation.  YOU get to decide how to style the document.  You can
lay out the page using tables for formatting, or you can use CSS.  You can
specify fonts inside elements using CSS or <font> elements, or in a separate
CSS stylesheet.  And so on and so on.

Now you can produce this page design using xslt no matter which approach you
take to "styling" the document.  And doing it inline is not that much
different in the xslt stylesheet whether you use CSS or html formatting
methods.

IOW, xslt is entirely neutral about how you choose to format the display
properties of your document.  I favor using CSS as much as reasonably
possible, and not putting styling information into the elements (but you
still have to write class and id attributes into them if you want to do
complex styling!), but again, that is not related to my use of xslt, but to
the design and maintenance of the page itself.  It is actually easier
(sometimes) to style inline because you have to do less planning and set up
fewer overhead structures, but I only do it for quick and dirty experiments,
and lately even for those I am styling using CSS.

On the other hand, you cannot re-arrange the order of things using CSS, and
here xslt is your friend.

So this is not an either-or thing, and it is not about which is "better"  It
is about how your finished document is designed.  The only time I can see
that it might seem otherwise is when you have a workable but largly unstyled
document already, and you want to add some rather generic styling to it (I
mean style rules that only use positional and element type selectors).  It
would be silly to use xslt to add font and color to elements when you could
just add some CSS rules up front instead.

But I do not think this situation is what the thread is about.

Cheers,

Tom P






 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS