Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Just use an XSLT stylesheet

by CloneArmyCommander (Friar)
on Apr 12, 2004 at 15:48 UTC ( #344410=note: print w/ replies, xml ) Need Help??


in reply to Just use an XSLT stylesheet

I completely agree with mirod :). I think some of us forget Perl's function as a glue language. If we keep redirecting other monks to solve their problems with other languages, such as XSLT, and I've even seen PHP, then we are slowly abandoning Perl, and even the Perl motto, "there is more than one way to do it." Instead of redirecting XSLT questions and saying the only way is XSLT, we should be looking into how can I find other ways to do it with Perl, as mirod says. This is what attracted me, and most likely other perl programmers, to this wonderful language.


Comment on Re: Just use an XSLT stylesheet
Re: Re: Just use an XSLT stylesheet
by mirod (Canon) on Apr 12, 2004 at 16:34 UTC

    To clarify my point: I am actually not saying that you should not use XSLT, I happen not to like it, but that's a purely personal opinion.

    Really, if anyone feels like it offers a good solution for a specific problem, then I am all for them proposing it. I would just like to see the code, exactly the same way we usually post code to show how we would use Perl. Hey, if I see enough code, and if it makes easy things that are hard to do in Perl, I might even start using it!

Re: Re: Just use an XSLT stylesheet
by hardburn (Abbot) on Apr 12, 2004 at 16:58 UTC

    No. TMTOWTDI shouldn't be abused to say "More than one way, as long as that way is in Perl". If XSLT could show sizeable benifits for XML manipulation over Perl + (insert CPAN module), then people's statements to suggest XSLT over Perl would be completely justified.

    However, XSLT is often far more verbose than a similar solution in Perl would be (there's an excelent article on Kuro5hin.org comparing XML manipulation in XSLT, Perl, and Haskell). That's the reason why people should avoid blindly suggesting the use of XSLT over Perl, not because it's not Perl.

    Being a good coder means knowing your tools and how best to apply them. Perl happens to be one of the most flexible tools you can find, but sometimes it isn't the one that should be used.

    ----
    : () { :|:& };:

    Note: All code is untested, unless otherwise stated

Re: Re: Just use an XSLT stylesheet
by Steve_p (Priest) on Apr 12, 2004 at 17:42 UTC

    I don't see that its good for anyone to advocate anything blindly. Perl is not the only solution, and in some cases, it is the wrong solution. I enjoy programming in Perl too, but I don't want to live next to a nuclear power plant where the control systems are written in Perl.

    mirod's point is that there are often solutions to problems with XML other than "just use XSLT". Many of the modules listed above often can handle the problems seen in SOPW. There, people are looking for suggestions or sample code to solve problems that they are running into. He's not blindly advocating Perl as the only solution, he would just like some code from people advocating an XSLT-based solution.

      Perl is not the only solution, and in some cases, it is the wrong solution.

      ..Now that is just crazy talk, Perl is the only solution, well 95% of the time...okay I'll give you that whole nuclear plant scenario.

Re: Re: Just use an XSLT stylesheet
by gellyfish (Monsignor) on Apr 16, 2004 at 11:30 UTC

    On the other hand there may be those who actually want the best solution to a problem (or maybe need it and just don't realize). I would imagine there are few here who would disagree that Perl is a powerful and expressive language with application in a wide range of problem domains, however there are going to be times when writing a Perl program, however cool and elegant, is not the best solution given the statement of the problem. This of course is not isolated to questions which may elicit the response 'use XSLT'.

    I'm not sure mirod was saying "how can I find other ways to do it with Perl" I think it was more like "give me an example that shows this is better than doing it with Perl" with which I heartlily concurr.

    /J\

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://344410]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2014-09-21 11:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (168 votes), past polls