Subject: | subrequests AxKit::XSP::Util get garbled by mod_rewrite |
Distribution: AxKit 1.6.1, with XSP.pm and LibXMLSupport from CVS:
$Id: XSP.pm,v 1.45 2003/07/16 15:02:11 matts Exp $
$Id: LibXMLSupport.pm,v 1.2 2003/03/18 15:19:46 matts Exp $
Perl Version: This is perl, v5.8.0 built for i686-linux
Operating System vendor and version:
Debian GNU/Linux Woody
Linux nsmweb 2.4.18-bf2.4 #1 Son Apr 14 09:53:28 CEST 2002 i686 unknown
Environment:
* XML::LibXML v1.51
* XML::LibXSLT v1.52
* AxKit::XSP::Util v1.6
* libxml2 v2.5.8
* libxslt v1.0.31
* XSP page on a virtual host, mod_rewrite enabled
Problem with AxKit::XSP::Util (tag include-file) + mod_rewrite:
when this page tries to load XML files, subrequests gets erroneously rewritten, this didn't happen with AxKit 1.5 and the same version of Util.
The page works again using include-uri and the axkit: "protocol specifier".
Page and logs follow:
Page:
<?xml version="1.0"?>
<xsp:page
xmlns:xsp="http://apache.org/xsp/core/v1"
xmlns:util="http://apache.org/xsp/util/v1"
indent-result="yes"
language="Perl">
<xsp:structure>
<xsp:logic>
<![CDATA[
use strict ;
use IO::File ;
use Apache::Constants ':common' ;
### CONFIGURATION ###############################################
my $idfile = 'count.id' ;
my $docroot = $r->document_root() ;
#################################################################
]]>
</xsp:logic>
</xsp:structure>
<msgqueue>
<xsp:logic>
my $id ;
{
my $idh = IO::File->new() ;
$idh->open($idfile,'r') or
throw Apache::AxKit::Exception::Retval(return_code => SERVER_ERROR);
$id = $idh->getline() ;
chomp $id ;
$idh->close() ;
}
<![CDATA[
for (my $i = 0 ; $i <= 19 ; $i++) {
my $file = "$docroot/id".($id-$i).".xml" ;
next unless -e $file and -f _ ;
]]>
<util:include-file>
<util:name><xsp:expr>$file</xsp:expr></util:name>
</util:include-file>
}
</xsp:logic>
</msgqueue>
</xsp:page>
To get working version of the page replace the for loop with:
<![CDATA[
for (my $i = 0 ; $i <= 19 ; $i++) {
my $file = "$docroot/id".($id-$i).".xml" ;
next unless -e $file and -f _ ;
my $href = "axkit:/id".($id-$i).".xml" ;
]]>
<util:include-uri>
<util:href><xsp:expr>$href</xsp:expr></util:href>
</util:include-uri>
}
Error log:
[AxKit] XSP Compilation finished
[AxKit] Turning off cache!
[AxKit] Cache: key = 682e0cfb0bb377411efcd40a3b965d7e
[AxKit] LibXSLT match_uri: /var/www/messygee/id5882.xml
[AxKit] LibXSLT open_content_uri: /var/www/messygee/id5882.xml
[AxKit] Content Provider Override: Apache::AxKit::Provider::File
[AxKit] decoding from UTF-8
[AxKit] [req] File Provider given $r: /var/www/messygee/var
[AxKit] encoding to UTF-8
[AxKit] Caught an exception
[AxKit] [UnCaught] File '/var/www/messygee/var' does not exist or is not readable
Rewrite log:
[rid#87c71f4/subreq] (2) init rewrite engine with requested u
ri /NULL
[rid#87c71f4/subreq] (1) pass through /NULL
[rid#887da24/subreq] (2) init rewrite engine with requested u
ri /var/www/messygee/id5884.xml
[rid#887da24/subreq] (1) pass through /var/www/messygee/id588
4.xml