Re: [xsl] Applying XSL transformation to non-xml (but fixed structure) file

Subject: Re: [xsl] Applying XSL transformation to non-xml (but fixed structure) file
From: Michael Kay <mike@xxxxxxxxxxxx>
Date: Wed, 02 Jun 2010 15:19:21 +0100
On 02/06/2010 15:07, Ruud Grosmann wrote:
Ruud Grosmann wrote:
Christian Schouten wrote:
Hi all,

I need to apply an XSL transformation to a non-xml file that has a fixed
structure.
The goal is to read in the file, add/edit/delete a record and write it
back.


hoi Christian,

ik antwoord je even rechtstreeks, want ik vloek niet graag in de kerk (de xsl-gemeenschap). Mijn eerste reactie is de vraag waarom iemand een xml tool zou willen gebruiken voor niet-xml-input. Waarom niet een simpel perl- of ruby-scriptje maken (of een andere taal naar keuze)?. Levert een fractie op van de code die je anders nodig hebt. Bovendien gebruik je het juiste hulpmiddel voor de juiste taak.

Heb je een reden dat je dat perse via xslt wilt?

groeten, Ruud


Sorry list,


I meant to send this message off list to Christian, that's why it is not in English.
Anyway, I suggested him to consider to use a tool like perl or ruby. Why use an xml tool for non xml input?



Thanks, I enjoyed deciphering your mail and I think I got the gist of it. ("My first reaction is to ask why anyone an XML tool would want to use for non-XML-input..") The answer is that if it's simple structured data, XSLT is quite capable of handling it, and the other capabilities of XSLT (pattern matching, XML output generation, etc) might well make it the most suitable tool. But if you're writing a parser for a recursive language, then despite Dimitre's herculean efforts to demonstrate that it *can* be done in XSLT, I would agree that probably it *should not* be done in XSLT, but instead should be pre-processed into XML using some other language.


Michael Kay
Saxonica

Current Thread