You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Joachim Zobel <nc...@netcologne.de> on 2001/04/21 23:07:22 UTC

Can AxKit be used as a Template Engine?

Hi.

I try to understand why and if this XML/XSL stuff is useful. Is it that 
transformations (XSL) of  XML to HTML can be used instead of the usual HTML 
templates (eg. Template-Toolkit)? Can this do what a template engine can 
do? Where are the limitations? Is there something it can't do?

Thanx,
Joachim

--
"... ein Geschlecht erfinderischer Zwerge, die fuer alles gemietet werden
koennen."                            - Bertolt Brecht - Leben des Galilei


Re: Must restart Apache when any .pm changes?

Posted by Matt Sergeant <ma...@sergeant.org>.
On Sun, 22 Apr 2001, Kee Hinckley wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> At 5:36 AM +0200 4/22/01, Issac Goldstand wrote:
> >man Apache::StatINC
> >
> >   Issac
>
> Apache::Reload seems better.  But if you have "use lib" statements in
> your code you'll need some patches to it that I don't believe have
> been released yet.

Actually that's a good prod - I'll try and put out a new release this
weekend.

-- 
<Matt/>

    /||    ** Founder and CTO  **  **   http://axkit.com/     **
   //||    **  AxKit.com Ltd   **  ** XML Application Serving **
  // ||    ** http://axkit.org **  ** XSLT, XPathScript, XSP  **
 // \\| // ** mod_perl news and resources: http://take23.org  **
     \\//
     //\\
    //  \\


Re: Must restart Apache when any .pm changes?

Posted by Kee Hinckley <na...@somewhere.com>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

At 5:36 AM +0200 4/22/01, Issac Goldstand wrote:
>man Apache::StatINC
>
>   Issac

Apache::Reload seems better.  But if you have "use lib" statements in 
your code you'll need some patches to it that I don't believe have 
been released yet.
- -- 

Kee Hinckley - Somewhere.Com, LLC
http://consulting.somewhere.com/consultants.html#kee

I'm not sure which upsets me more: that people are so unwilling to accept
responsibility for their own actions, or that they are so eager to regulate
everyone else's.

-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>

iQA/AwUBOuL/CyZsPfdw+r2CEQL6OACfeNOrBhEepJYa5gXlxEKBkr6fK7QAn26P
QJDqxJUeiv6lxAEhF4epMjtp
=Q3Cf
-----END PGP SIGNATURE-----

Re: Must restart Apache when any .pm changes?

Posted by Issac Goldstand <ne...@writeme.com>.
man Apache::StatINC

  Issac

Internet is a wonderful mechanism for making a fool of
yourself in front of a very large audience.
  --Anonymous
 
Moving the mouse won't get you into trouble...  Clicking it might.
  --Anonymous
 
PGP Key 0xE0FA561B - Fingerprint:
7E18 C018 D623 A57B 7F37 D902 8C84 7675 E0FA 561B

----- Original Message ----- 
From: "Steve Leibel" <st...@bluetuna.com>
To: <mo...@apache.org>
Sent: Sunday, April 22, 2001 4:14 AM
Subject: Must restart Apache when any .pm changes?


> I'm experimenting with using Perl modules (.pm files) underneath 
> Mason components.
> 
> As far as I can see, the only way to guarantee that changes made in 
> the .pm are seen by the Mason code is to restart Apache whever the 
> .pm file changes.  This is true whether the "use" statement is in 
> handler.pl or in the component.
> 
> I believe the way this works is that the first time any Apache child 
> process sees "use Foo" that is the version of Foo.pm that will be 
> used by that process.  No subsequent "use Foo" within components will 
> have any effect during the life of that Apache process.
> 
> Am I understanding this correctly?
> 


Re: Must restart Apache when any .pm changes?

Posted by Dave Rolsky <au...@urth.org>.
On Sat, 21 Apr 2001, Steve Leibel wrote:

> I believe the way this works is that the first time any Apache child
> process sees "use Foo" that is the version of Foo.pm that will be
> used by that process.  No subsequent "use Foo" within components will
> have any effect during the life of that Apache process.
>
> Am I understanding this correctly?

Yes, mostly.  Check out the Apache::Reload module though.  It does what I
think you want.


-dave

/*==================
www.urth.org
We await the New Sun
==================*/


Must restart Apache when any .pm changes?

Posted by Steve Leibel <st...@bluetuna.com>.
I'm experimenting with using Perl modules (.pm files) underneath 
Mason components.

As far as I can see, the only way to guarantee that changes made in 
the .pm are seen by the Mason code is to restart Apache whever the 
.pm file changes.  This is true whether the "use" statement is in 
handler.pl or in the component.

I believe the way this works is that the first time any Apache child 
process sees "use Foo" that is the version of Foo.pm that will be 
used by that process.  No subsequent "use Foo" within components will 
have any effect during the life of that Apache process.

Am I understanding this correctly?

Re: Can AxKit be used as a Template Engine?

Posted by ed phillips <ar...@sirius.com>.
Michael Alan Dorman wrote:

> Matt Sergeant <ma...@sergeant.org> writes:
> > It depends a *lot* on the type of content on your site. The above
> > www.dorado.com is brochureware, so it's not likely to need to be
> > re-styled for lighter browsers, or WebTV, or WAP, or... etc. So your
> > content (I'm guessing) is pure HTML, with Mason used as a fancy way
> > to do SSI, with Mason components for the title bars/menus, and so
> > on. (feel free to correct me if I'm wrong).
>
> It is more sophisticated than that, but you're basically right.  I do
> pull some tagset-like tricks for individual pages, so it's not totally
> pure HTML, but yeah, if we wanted to do WebTV we'd be fscked.
>
> > AxKit is just as capable of doing that sort of thing, but where it
> > really shines is to provide the same content in different ways,
> > because you can turn the XML based content into HTML, or WebTV HTML,
> > or WML, or PDF, etc.
>
> Ah---well a web site that does all of that isn't what first comes to
> mind when someone talkes about doing a "static site"---though now that
> you've explained further, I believe I understand exactly what you
> intended.
>
> > I talk about how the current Perl templating solutions (including
> > Mason) aren't suited to this kind of re-styling in my AxKit talk,
> > which I'm giving at the Perl conference, so go there and come see
> > the talk :-)
>
> Heh.  I agree entirely with this assesment---I can conceptualize a way
> to do it in Mason, but the processing overhead would be unfortunate,
> the amount of handwaving involved would be enormous, and it would
> probably be rather fragile.
>
> > So I take back that people wouldn't be using Mason for static
> > content. I was just trying to find a simple way to classify these
> > tools, and to some people (I'd say most people), Mason is more on
> > the dynamic content side of things, and AxKit is more on the static
> > content side of things, but both tools can be used for both types of
> > content.
> >
> > (I hate getting into these things - I wish I'd never brought up
> > Mason or EmbPerl)
>
> Well I will say that you made an excellent point that hadn't really
> occured to me---I use XML + XSL for a lot of stuff (the DTD I use for
> my resume is a deeply reworked version of one I believe you had posted
> at one time), but not web sites, in part because I'm not currently
> obligated to worry about "other devices"---so I don't exactly regret
> getting you to clarify things.
>
> Could I suggest that a better tagline would be that AxKit is superior
> when creating easily (re-)targetable sites with mostly static content?
> It might stave off more ignorant comments.
>
> Mike.

Matt,

I've also found your use of "static" to describe "transformable" or
"re-targetable"(unfortunate
word)" content to be confusing. This discussion helps clarify things, a
little. ;-)

Ed



Re: Can AxKit be used as a Template Engine?

Posted by Matt Sergeant <ma...@sergeant.org>.
On 23 Apr 2001, Michael Alan Dorman wrote:

> Well I will say that you made an excellent point that hadn't really
> occured to me---I use XML + XSL for a lot of stuff (the DTD I use for
> my resume is a deeply reworked version of one I believe you had posted
> at one time), but not web sites, in part because I'm not currently
> obligated to worry about "other devices"---so I don't exactly regret
> getting you to clarify things.

You may find the following makefile quite useful (I'm thinking of dubbing
this AxKit 2.0 :-)

# using gnome libxslt
XSLT=xsltproc

# dependencies for *.html
%.html : %.xml %_html.xsl
        $(XSLT) $*_html.xsl $< > $@

# dependencies for *.wml
%.wml : %.xml %_wml.xsl
        $(XSLT) $*_wml.xsl $< > $@

# list of files
all: foo.html bar.html foo.wml bar.wml


> Could I suggest that a better tagline would be that AxKit is superior
> when creating easily (re-)targetable sites with mostly static content?
> It might stave off more ignorant comments.

I'll think about adding it to my .sig :-)

-- 
<Matt/>

    /||    ** Founder and CTO  **  **   http://axkit.com/     **
   //||    **  AxKit.com Ltd   **  ** XML Application Serving **
  // ||    ** http://axkit.org **  ** XSLT, XPathScript, XSP  **
 // \\| // ** mod_perl news and resources: http://take23.org  **
     \\//
     //\\
    //  \\


Re: Can AxKit be used as a Template Engine?

Posted by Michael Alan Dorman <md...@debian.org>.
Matt Sergeant <ma...@sergeant.org> writes:
> It depends a *lot* on the type of content on your site. The above
> www.dorado.com is brochureware, so it's not likely to need to be
> re-styled for lighter browsers, or WebTV, or WAP, or... etc. So your
> content (I'm guessing) is pure HTML, with Mason used as a fancy way
> to do SSI, with Mason components for the title bars/menus, and so
> on. (feel free to correct me if I'm wrong).

It is more sophisticated than that, but you're basically right.  I do
pull some tagset-like tricks for individual pages, so it's not totally
pure HTML, but yeah, if we wanted to do WebTV we'd be fscked.

> AxKit is just as capable of doing that sort of thing, but where it
> really shines is to provide the same content in different ways,
> because you can turn the XML based content into HTML, or WebTV HTML,
> or WML, or PDF, etc.

Ah---well a web site that does all of that isn't what first comes to
mind when someone talkes about doing a "static site"---though now that
you've explained further, I believe I understand exactly what you
intended.

> I talk about how the current Perl templating solutions (including
> Mason) aren't suited to this kind of re-styling in my AxKit talk,
> which I'm giving at the Perl conference, so go there and come see
> the talk :-)

Heh.  I agree entirely with this assesment---I can conceptualize a way
to do it in Mason, but the processing overhead would be unfortunate,
the amount of handwaving involved would be enormous, and it would
probably be rather fragile.

> So I take back that people wouldn't be using Mason for static
> content. I was just trying to find a simple way to classify these
> tools, and to some people (I'd say most people), Mason is more on
> the dynamic content side of things, and AxKit is more on the static
> content side of things, but both tools can be used for both types of
> content.
> 
> (I hate getting into these things - I wish I'd never brought up
> Mason or EmbPerl)

Well I will say that you made an excellent point that hadn't really
occured to me---I use XML + XSL for a lot of stuff (the DTD I use for
my resume is a deeply reworked version of one I believe you had posted
at one time), but not web sites, in part because I'm not currently
obligated to worry about "other devices"---so I don't exactly regret
getting you to clarify things.

Could I suggest that a better tagline would be that AxKit is superior
when creating easily (re-)targetable sites with mostly static content?
It might stave off more ignorant comments.

Mike.

Re: Can AxKit be used as a Template Engine?

Posted by Matt Sergeant <ma...@sergeant.org>.
On 23 Apr 2001, Michael Alan Dorman wrote:

> Errr, respectfully, I think you underestimate Mason's capabilities.

Not really. I've researched Mason quite a bit, and I talk with Jon every
ApacheCon/OSSCON about how we can bring together the Mason and AxKit
synergy. Now Jon has been to my talk, we both know about the advantages of
each solution.

> www.dorado.com/ is the website for the company I do most of my
> contracting with, built entirely in Mason, and it's almost totally
> static content, but we make extensive---almost exclusive---use of
> Mason's autohandler capabilities coupled with Mason's "object
> oriented" features to divorce individual pages from the overall
> presentation.
>
> As a result we were recently able to give the entire site a makeover
> in roughly three days from start to finish, because it's designed to
> largely separate content from templating.  We had to change almost no
> individual page files, just the autohandler (read: template) that
> handles the site, plus tweaking the names of some rollover graphics.
>
> No more work than redoing the XPathScript and tweaking your taglibs,
> really.

It depends a *lot* on the type of content on your site. The above
www.dorado.com is brochureware, so it's not likely to need to be re-styled
for lighter browsers, or WebTV, or WAP, or... etc. So your content (I'm
guessing) is pure HTML, with Mason used as a fancy way to do SSI, with
Mason components for the title bars/menus, and so on. (feel free to
correct me if I'm wrong).

AxKit is just as capable of doing that sort of thing, but where it really
shines is to provide the same content in different ways, because you can
turn the XML based content into HTML, or WebTV HTML, or WML, or PDF, etc.
I talk about how the current Perl templating solutions (including Mason)
aren't suited to this kind of re-styling in my AxKit talk, which I'm
giving at the Perl conference, so go there and come see the talk :-)

So I take back that people wouldn't be using Mason for static content. I
was just trying to find a simple way to classify these tools, and to some
people (I'd say most people), Mason is more on the dynamic content side of
things, and AxKit is more on the static content side of things, but both
tools can be used for both types of content.

(I hate getting into these things - I wish I'd never brought up Mason or
EmbPerl)

-- 
<Matt/>

    /||    ** Founder and CTO  **  **   http://axkit.com/     **
   //||    **  AxKit.com Ltd   **  ** XML Application Serving **
  // ||    ** http://axkit.org **  ** XSLT, XPathScript, XSP  **
 // \\| // ** mod_perl news and resources: http://take23.org  **
     \\//
     //\\
    //  \\


Re: Can AxKit be used as a Template Engine?

Posted by Michael Alan Dorman <md...@debian.org>.
Matt Sergeant <ma...@sergeant.org> writes:
> The one thing I think AxKit does really well, that other
> "templating" solutions aren't really designed for, is allowing you
> to build your whole web site with that solution. So for example,
> Mason and EmbPerl are really great for building the dynamic parts of
> your site, whereas (I imagine, from experience) people will build
> the more static parts of their site with just plain HTML.

If they are doing that with Mason, they're making a _BIG_ mistake, as
you are in suggesting it's not well suited for doing static sites.

> Whereas with AxKit the XML + Stylesheets approach applies much more
> broadly to the whole site.

Errr, respectfully, I think you underestimate Mason's capabilities.

www.dorado.com/ is the website for the company I do most of my
contracting with, built entirely in Mason, and it's almost totally
static content, but we make extensive---almost exclusive---use of
Mason's autohandler capabilities coupled with Mason's "object
oriented" features to divorce individual pages from the overall
presentation.

As a result we were recently able to give the entire site a makeover
in roughly three days from start to finish, because it's designed to
largely separate content from templating.  We had to change almost no
individual page files, just the autohandler (read: template) that
handles the site, plus tweaking the names of some rollover graphics.

No more work than redoing the XPathScript and tweaking your taglibs,
really.

> Now I'm probably going to get replies to this saying how EmbPerl and
> Mason and (insert other solution) can do this. And I'm sure they
> can. I just think it's more natural with AxKit.

Well, you did write AxKit---I'd hope it'd be natural. :-)

I've looked at AxKit a lot, and I think it's a great tool that I want
to use---now that there's a Debian package so I don't have to do the
work to get it installed.  The next static site I do for myself, I'll
probably try out AxKit---though I just admit that I'd like to see XSLT
support, too---but I also think you do Mason a disservice.

I will make the caveat that I think I've been using Mason for three
years now---almost since it's first public release---and I've built
many a static web site with it.  I've even got a site that uses XSLT
to do transforms of XML files which are then handed off to Mason.

Mike.

Re: Can AxKit be used as a Template Engine?

Posted by brian moseley <bc...@maz.org>.
On Mon, 23 Apr 2001, Matt Sergeant wrote:

> The alternative of course it to just plug them both
> together - AxKit and Mason play nicely together using
> Apache::Filter (though it's a bit slow).

with version 2.3 of the java servlet api, you can now create
input and output filters, just like the filters in apache
2.0. so your servlet can do the "mason" stuff and an output
filter can do the "cocoon" stuff.

i feel justified in throwing this out because i'm finally
back to work on the perl servlet engine :)


Re: Can AxKit be used as a Template Engine?

Posted by Matt Sergeant <ma...@sergeant.org>.
On Mon, 23 Apr 2001, Ian Kallen <ia...@covalent.net> wrote:

> Mason and AxKit solve different but related problems.  The former a
> code-aware component system with process semantics that lend itself to
> easily scoping a component's applicability, the latter a
> transformation engine.  It would be nice to see a framework published
> that uses the best of both (sorry, I don't have time to do it myself
> :).  The Java world suffers from the same disconnect, in fact I think
> it's worse there; JSP and Cocoon don't play together (I've never seen
> a servlet chainging example that shows them doing so).

Actually what I'm looking at and talking to Phillipe about right now is
somehow doing the thing Smartworker does, but using XML and
transformations, and adding in AxKit's abilities to detect the requesting
device and "do the right thing". I think that would be the best way to
build large scale web apps for multiple delivery targets.

The alternative of course it to just plug them both together - AxKit and
Mason play nicely together using Apache::Filter (though it's a bit slow).

-- 
<Matt/>

    /||    ** Founder and CTO  **  **   http://axkit.com/     **
   //||    **  AxKit.com Ltd   **  ** XML Application Serving **
  // ||    ** http://axkit.org **  ** XSLT, XPathScript, XSP  **
 // \\| // ** mod_perl news and resources: http://take23.org  **
     \\//
     //\\
    //  \\


Re: Can AxKit be used as a Template Engine?

Posted by "Ian Kallen <iank@covalent.net>" <ia...@covalent.net>.
Mason and AxKit solve different but related problems.  The former a
code-aware component system with process semantics that lend itself to
easily scoping a component's applicability, the latter a transformation
engine.  It would be nice to see a framework published that uses the best
of both (sorry, I don't have time to do it myself :).  The Java world
suffers from the same disconnect, in fact I think it's worse there; JSP
and Cocoon don't play together (I've never seen a servlet chainging
example that shows them doing so).

On Mon, 23 Apr 2001, Matt Sergeant wrote:
> Having said that, it goes the other way too - currently building web
> applications is probably a lot easier with Mason than it is with AxKit,
> because that's what it was designed for. AxKit has a pretty cool
> technology called XSP, which gives you a cold-fusion like system of
> inserting tags into your XML for dynamic functionality. But in my opinion
> it doesn't scale well (in the development sense, not in the performance
> sense) to large applications, because it is inherently a page-based
> technology (like PHP, Cold Fusion, JSP, ASP, etc), and I don't think
> page-based web development systems scale well to larger applications. I
> prefer something that is turned inside-out from the page based view of
> things, like MVC.

cheers,
-Ian

--
Ian Kallen <ia...@covalent.net> | AIM: iankallen


Re: Can AxKit be used as a Template Engine?

Posted by Matt Sergeant <ma...@sergeant.org>.
On Sat, 21 Apr 2001, Joachim Zobel wrote:

>
> Hi.
>
> I try to understand why and if this XML/XSL stuff is useful. Is it that
> transformations (XSL) of  XML to HTML can be used instead of the usual HTML
> templates (eg. Template-Toolkit)?

Partly. But XSLT is also able to transform documents, which is an
incredibly useful feature that no other Perl templating module (except
XPathScript) is able to do well. Hard to describe without an example, of
which there are plenty on the 'net so I won't spam the group here.

> Can this do what a template engine can
> do? Where are the limitations? Is there something it can't do?

Not really, AxKit is as powerful as the other solutions out there, I'd
say (well I would, wouldn't I :-). The one thing I think AxKit does really
well, that other "templating" solutions aren't really designed for, is
allowing you to build your whole web site with that solution. So for
example, Mason and EmbPerl are really great for building the dynamic parts
of your site, whereas (I imagine, from experience) people will build the
more static parts of their site with just plain HTML. Whereas with AxKit
the XML + Stylesheets approach applies much more broadly to the whole
site.

Now I'm probably going to get replies to this saying how EmbPerl and Mason
and (insert other solution) can do this. And I'm sure they can. I just
think it's more natural with AxKit.

Having said that, it goes the other way too - currently building web
applications is probably a lot easier with Mason than it is with AxKit,
because that's what it was designed for. AxKit has a pretty cool
technology called XSP, which gives you a cold-fusion like system of
inserting tags into your XML for dynamic functionality. But in my opinion
it doesn't scale well (in the development sense, not in the performance
sense) to large applications, because it is inherently a page-based
technology (like PHP, Cold Fusion, JSP, ASP, etc), and I don't think
page-based web development systems scale well to larger applications. I
prefer something that is turned inside-out from the page based view of
things, like MVC.

I have another article on this coming soon that should make things a bit
(or a lot) clearer. I'll keep the list informed when it's ready.

-- 
<Matt/>

    /||    ** Founder and CTO  **  **   http://axkit.com/     **
   //||    **  AxKit.com Ltd   **  ** XML Application Serving **
  // ||    ** http://axkit.org **  ** XSLT, XPathScript, XSP  **
 // \\| // ** mod_perl news and resources: http://take23.org  **
     \\//
     //\\
    //  \\