Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

2shortplanks (968)

  (email not shown publicly)
AOL IM: trelane2sp (Add Buddy, Send Message)
Yahoo! ID: trelane2sp (Add User, Send Message)

Mark Fowler has never been the same since he was elected leader of the London Perl Mongers. The strain manifests itself mainly in releasing various [] modules [] to CPAN, giving talks [], and use of the Trelane nick on for endless procrastination. Doctors are still seeking a cure.
Friday August 13, 2004
02:43 AM

More on AxKit and TT

[ #20390 ]
So I've again been playing around with the idea of a Template Toolkit Language plugin for AxKit. Developing the example in kip's book to work with XML::LibXML. Which should be really easy, apart from the fact that Template::Plugin::XML::LibXML wasn't passing tests. Ooops. Much patching of the tests and a release to CPAN yesterday fixed that.

So I've been actually trying to use Apoche::Test to test this module and I'm slowly getting there. It's quite swish when it works (we don't use it ourselves at work because apparently it's too clever and autodetects things outside of our build system!) I'm currently playing with writing dummy AxKit lanaguages that unconditionally dump different things in the pipeline so that I can test that the TT language reads and understands the previous data from the pipeline fine.

Once I've got the basic version done there's still big problems ahead. Firstly, there's the issue of caching. Currently I'm creating a new TT object every time, which means that every single time a TT stylesheet is used it's turning the template into Perl code. This is about ten times slower than reusing an existing lump of code. So I need to somehow merge TT's providers with AxKit's providers so that caching works. Which should be fun. The second major issue is configuration. As far as I can see it atm, the configuration for things like INCLUDE_PATH that kip's already done is on a per server not per stylesheet basis (or perl Location block directive). I'm not sure what the right thing to do here is...I'll have to give it some thought.

Anyway, slowly but surely.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • I remember seeing code from either Matt or Andy that did this years ago.
    • Oh yes, they did make code that does this years ago, but it never got released. I wrote an improved version back in 2001, but never really got anywhere with that either. And I didn't commit it into a version control system (DOH!) so it's lost now.

      The new version uses Template::Plugin::XML::LibXML, which should be a lot quicker since it means you don't have to reparse the XML in the pnotes dom_tree if you've got one. And of course XML::LibXML's quicker and has better namespace support.