Re: The suitability of XSL

Kip Hampton <[email protected]>
Newsgroups gmane.comp.lang.perl.xml
Message-ID <[email protected]>
Howdy,

Lot's of worthwhile discussion about using the right tool for the job 
(XSL vs Perlishness) but not a lot of detail about when to use which and 
what criteria to use to decide. Really, that's the underlying question, 
isn't it?

Broadly speaking, XSLT is best for transforming deeply nested 
document-centric XML (docbook, XHTML) while Perlish, programmatic 
solutions (SAX, Twig, XML::Simple, etc) are best for shallower 
data-centric XML.

Why?

Because XSLT is at its best (and simplest and most powerful) when it is 
used for *recursive* transformations. That is, "find this element, 
transform it in this way, apply these other rules to that element's 
children", rinse and repeat.

Most of the heartache (and crappy XSL) I've seen over the years has come 
from cases where people-- myself included-- tried to use XSL as a 
functional, iterative programing language. They try to write big rules 
that transform large chunks of the document at once instead of writing 
smaller template rules that use selective recursion.

Just my .02 (not adjusted for inflation)

-kip
_______________________________________________
Perl-XML mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.