[development] XML transformations using XSL
larry at garfieldtech.com
Thu May 25 18:15:56 UTC 2006
XSLT is a very cool and powerful beast once you learn how to talk to it.
The mistake many people make is trying to treat it as a programming
language. It isn't. It's a templating/transformation language with
functional programming concepts (think ML).
If you're converting one XML stream into another XML stream, XSLT is just
what you need. I use it for a DocBook->XHTML/DocBook->XSLFO->PDF project,
and it's great. If you have to go to the effort of manually building or
dissecting the XML on one side or the other, though, then you're probably
better off just skipping that step in the first place.
Although PHP using <?php ?> doesn't make it inherently an XML PI. If
anything, the two clash like crazy if you have short tags enabled. :-)
On Thu, May 25, 2006 10:56 am, Dan Robinson said:
> my $.02,
> I used XSLT for a project like this a couple years ago. It is designed
> for this kind of thing and is very cool. However it is likely (as
> others point out) that there are a lot of features you don't need and
> furthermore XSLT is (IMO) one of those "wacky" tools that just seems to
> want to do everything "sideways" - the learning curve is pretty stiff.
>>> Yup. Using XSLT adds a hell of a lot more 'moving parts' than is
>>> strictly necessary, and in general working with a database is far far
>>> simpler, and more
>>> easily maintainable by a larger group of people.
>> Yep, and strictly speaking XSL is an overcomplicated beast - too general
>> for its own good. It can be useful is some specific cases, but within
>> drupal it is better to stick to php. It is a XML processing instruction
>> after all, hence the <?php ?>
More information about the development