http://qs321.pair.com?node_id=142160


in reply to Re: XSLT vs Templating?
in thread XSLT vs Templating?

Ok, that starts to piece together what I get out from reading J2EE journals (one recent piece talked about a series of XSLT filters to get from one transformation to another). And given that XHTML is XML-compliant, it makes sense as well.

Now, to further clarify what I should proceed, I'm looking at basically cleaning up a site, such that I generate XML and then generate the (X)HTML from that. This is mostly for my own learning benefit, so I'm open to any route, but I'm also trying to keep it to an efficient method as well (on an older machine, too). In addition to any XML that I generate from a DB, I also want to add the standard header, footer items, handle CGI form elements, as well as implementing user-based customizations. Ideally, I'd like one single script (with multiple callouts depending on state) to do this, basically waiting from XML recieved from the callouts, then processing it in some fashion.

It sounds like both TT2 (templates in general) and XSLT can do this, with XSLT being a tad better since I can use two transformations, one to get the XML into a form that I can then apply a user-based transformation on. But again, I'm still new to this and trying to decide which way to go from here. Any further suggestions at this point? (It should be noted this is all with perl and apache and postgres if that should matter).

-----------------------------------------------------
Dr. Michael K. Neylon - mneylon-pm@masemware.com || "You've left the lens cap of your mind on again, Pinky" - The Brain
"I can see my house from here!"
It's not what you know, but knowing how to find it if you don't know that's important

Replies are listed 'Best First'.
Re: Re: Re: XSLT vs Templating?
by Matts (Deacon) on Jan 29, 2002 at 01:39 UTC
    The right way to do something is a very hard question indeed. Especially where web stuff is involved.

    You mention Apache and Perl. But are you using mod_perl? In which case AxKit might be a good bet. If not, take a look at CGI::XMLApplication, and also see Kip Hampton's recent articles on XML.com talking about that module.

    If you go the AxKit route, look into XSP, specifically AxKit::XSP::ESQL (on CPAN) for doing SQL. If you go the CGI::XMLApplication route, check out XML::Generator::DBI and XML::LibXML::SAX::Builder to build a DOM from the results, and pass it to XML::LibXSLT for transformation.

    Probably sounds like an overwhelming number of options. So let me know if you want further details!