Hi.

I spotted this from the Sep archives, and Brian's problem sounds similar
to mine.

test.xml
--------
<?xml version='1.0'?>
<?xml-stylesheet
    href="/xps/test.xps"
    type="application/x-xpathscript"
    title="default"
    alternate="no"?>
<page></page>

test.xps
--------
<%
    $t->{'page'}{'testcode'}=import_template('/xps/include.xps');
%>
<html>
<body>
    plain text<br>
    <%= $$ %><br>
    <%= apply_templates('/page') %><br>
</body>
</html>

include.xps
-----------
hello world


I noticed that import_template only works on the first invocation of
each Apache process. On the second and subsequent invocations, "hello
world" is not included. This seems to be independant of the AxNoCache
setting.

In XPathScript.pm import_template() line 450, include_file() is
invoked. My question is:

Is
    return '' if grep {$_ eq $filename} @{$stash->{$key}{includes}};

in include_file line 293 necessary? The test script works after I've
commented the said line. Or perhaps $stash->{$key} should have been
re-initialized elsewhere. I am not very sure how AxKit's caching system
works; hope someone can help out.

Thanks!

Versions:
1. AxKit 1.6 / mod_perl 1.26 / Apache 1.3.22 / Perl 5.6.1 / Mandrake 8.1
1. AxKit 1.6 / mod_perl 1.27 / Apache 1.3.26 / Perl 5.8   / Mandrake 9

On Tuesday, September 3, 2002, at 01:27  pm, brian wheeler wrote:

> I'm having some caching problems with AxKit 1.6 using import_template.
> It seems that once the imported template is cached, it stops
> generating
> content...but the other normally included templates (via <!--#include
> -->) work like they're supposed to.
>
> Any thoughts?
> Brian
>
>
> Versions:
> Axkit 1.6
> Apache 1.3.26
> mod_perl 1.27
> Redhat 7.1
> Perl 5.8
>
>
> Code snippet that fails:
>
> ...
>         if(!exists($real_name{$section})) {
>             $section="snapshot";
>         }
>
> $t->{testcode}=import_template("/stylesheets/default-college_profile-
> $section.xps",1);
>   return -1;
> ...



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to