Hello, on Freitag, 9. März 2007, Thomas Schraitle wrote:
On Freitag, 9. März 2007, Christian Boltz wrote: [...]
XSLT and fun?
As always it is a matter of taste.
;-)
I usually get headache. OK, it wasn't a big problem with this small file, but I had "some" bad experience with the XLS files for the german SUSE Linux FAQ...
From my work with XSLT, you get headache when
* your XML sucks. Really, some XML is so deeply wrong structured that it takes you a glass of Aspirin (at least!) to write a decent XSLT stylesheet.
Hmm, I wouldn't call the FAQ XML wrong structured ;-)
* you write XSLT stylesheets like a procedural programming language.
Maybe, we took the XLST from php-faq.de and modified it for our needs.
* you use XSLT for something that it was not invented for. For example, creating some kind of "binary" output from the transformation.
no, just HTML (and LaTeX, but that one is not really problematic).
* you don't use the full potential of XSLT. For example using xsl:for-each instead of xsl:apply-templates where it is in most cases more appropriate.
Hmmm... cb@cboltz:~/suse-linux-faq/dtd/html> grep for-each * |wc -l 73 cb@cboltz:~/suse-linux-faq/dtd/html> grep apply-templates * |wc -l 13
* you don't have a good book or a reference. :)
Good point ;-)
* you don't know how to sort indices with umlauts. Arggh!
In general, I get always headaches with the last point. ;-)
*g* Another headache candidate: * you need a table of content / menu _and_ (part of the) content in the same output file (this explains why the LaTeX output was easier - it does the TOC automatically) If you have some free time and are interested, you can have a look at it: cvs -d :pserver:anonymous@koehntopp.de:/faq co suse-linux-faq (Needless to say: it works, but patches to make it nicer are accepted.)
From my daily work here I haven't found a better solution than XSLT.
Maybe, if you have to handle XML. (Kris Köhntopp recommended some newer PHP functions once, but I didn't test them yet.) My solution is usually to avoid XML and therefore XSLT if possible. (This does not mean that XML itsself is bad - but handling it...)
In most cases, XSLT is good enough. But I agree, for some parts you need Aspirin. ;-)
| addsig *g* Regards, Christian Boltz, apropos Kris Köhntopp... -- xslt, was? Wir kombinieren das Paradigma von awk mit der sprachlichen Eleganz von Cobol und den programmiertechnischen Verrenkungen von funktionalen Sprachen unter sorgfältiger Umgehung aller möglichen Vorteile. [Kristian Köhntopp] --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-doc+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-doc+help@opensuse.org