"John D. Leonard II" wrote:
>
> > For XMLSubs shorthand of this I might:
> > # httpd.conf
> > PerlSetVar XMLSubs my:header
> >
> > and then:
> > # global.asa, or my.pm, or My::Tags, which is used in global.asa
> > sub my::header {
> > $main::Response->Include('head.inc', @_);
> > }
> >
> > so I could finally:
> > <my:header title="$title" />
> >
>
> How is performance with the XML approach versus the regular perl approach?
> I'm tempted to begin my foray into the world of XML, but want to know if
> there is gold at the end of the (what appears to be) steep learning curve.
An XMLSub is compiled into a perl subroutine call like &my::header(),
and there would be some overhead for some related string buffer output
copying, but as I showed in a benchmark recently, the overhead was not
so much at runtime.
However, as Philip discovered recently, the compiling of a ASP script
with lots of XMLSubs can slow down quite a bit. In his case, a script
that had near 200 XMLSubs in it took 3-4 seconds to compile on my
machine. With some optimizations in my dev version 2.23 however, I
brought this compile time down to .7 seconds. This time would go down
to near zero if the scripts were precompiled/cached in the parent httpd
with Apache::ASP->Loader().
Note mixing in XMLSubs with HTML does not produce valid XML. If
you would like a pure XML approach, I would recommend looking into
XSLT which Apache::ASP also supports. In the latter case, the ASP
script and XSL template are processed as ASP scripts, with the
output XML used for the transformation into the final output.
The final XSLT is actually handled by the XSLTParser XML::XSLT
or XML::Sablotron with an intervening dbm based XSLTCache.
--Josh
_________________________________________________________________
Joshua Chamas Chamas Enterprises Inc.
NodeWorks Founder Huntington Beach, CA USA
http://www.nodeworks.com 1-714-625-4051
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]