All,
I'm running Apache-1.3.4, mod_perl-1.26 and AxKit-1.51 under (SPARC)
Solaris 8. After following the "quick ref" stuff and examples on
axkit.org, the XSLT examples work as I'd expect, but I'm *not* able to
use the XSP examples, for reasons unknown to me.
Could someone take a look at the following and let me know what might
be going on? I don't see any content in my browser when I use
XPathScript, and I'm not quite sure what I'm looking at in the error
log. Would be appreciated...
1. My httpd.conf (none of the below is enclosed in <...>).
PerlModule AxKit
SetHandler perl-script
# debug
AxDebugLevel 10
AxGzipOutput On
# set these
PerlSetVar AxXPSInterpolate 1
PerlSetVar AxTranslateOutput 1
PerlHandler AxKit
AddHandler axkit .xml .xps .dkb
AxCacheDir /var/tmp/axkit_cache/
AxAddStyleMap text/xsl Apache::AxKit::Language::LibXSLT
AxAddStyleMap application/x-xpathscript Apache::AxKit::Language::XPathScript
# add the following only if you intend to install Sablotron
#AxAddStyleMap text/xsl Apache::AxKit::Language::Sablot
2. My test-xps.xml, which lives in DocumentRoot:
<?xml version="1.0"?>
<?xml-stylesheet href="test.xps" type="application/x-xpathscript"?>
<dromedaries>
<species name="Camel">
<humps>1 or 2</humps>
<disposition>Cranky</disposition>
</species>
<species name="Llama">
<humps>1 (sort of)</humps>
<disposition>Aloof</disposition>
</species>
<species name="Alpaca">
<humps>(see Llama)</humps>
<disposition>Friendly</disposition>
</species>
</dromedaries>
3. My test.xps, which also lives in DocumentRoot:
<%
$t->{'humps'}{'pre'} = "<td>";
$t->{'humps'}{'post'} = "</td>";
$t->{'disposition'}{'pre'} = "<td>";
$t->{'disposition'}{'post'} = "</td>";
$t->{'species'}{testcode} = sub {
my $node = shift;
my $t = shift;
$t->{pre} = '<tr><td>' . findvalue('@name', $node) . '</td>';
$t->{post} = "</tr>";
return 1;
}
%>
<html>
<head>
<title>Know Your Dromedaries</title>
</head>
<body bgcolor="white">
<table bgcolor="eeeeee" border="1">
<tr><th>Species</th><th>No. of Humps</th><th>Disposition</th></tr>
<%= apply_templates('/dromedaries/species') %>
</table>
</body>
</html>
4. My errors.
(These errors were generated in my Apache error_log when I tried to
access test-xps.xml.)
- pr 17 14:16:24 2002] [warn] [client 192.168.0.6] [AxKit] handler
called for /test-xps.xml
[Wednesday Apr 17 14:16:24 2002] [warn] [client 192.168.0.6] [AxKit]
checking if we process this resource
[Wednesday Apr 17 14:16:24 2002] [warn] [client 192.168.0.6] [AxKit]
media: screen, preferred style: #default
[Wednesday Apr 17 14:16:24 2002] [warn] [client 192.168.0.6] [AxKit]
Cache: key = b05a8f746fbe459fe1ebdf4ad5c85757
[Wednesday Apr 17 14:16:24 2002] [warn] [client 192.168.0.6] [AxKit]
getting styles and external entities from the XML
[Wednesday Apr 17 14:16:24 2002] [warn] [client 192.168.0.6] [AxKit]
styles not cached - calling $provider->get_styles()
[Wednesday Apr 17 14:16:24 2002] [warn] [client 192.168.0.6] [AxKit]
using XS get_styles (libxml2)
[Wednesday Apr 17 14:16:24 2002] [warn] [client 192.168.0.6] [AxKit]
calling xs_get_styles_fh()
[Wednesday Apr 17 14:16:24 2002] [warn] [client 192.168.0.6] [AxKit]
calling xs_get_styles_str()
[Wednesday Apr 17 14:16:24 2002] [warn] [client 192.168.0.6] [AxKit]
parse_pi: href = test.xps
[Wednesday Apr 17 14:16:24 2002] [warn] [client 192.168.0.6] [AxKit]
parse_pi: type = application/x-xpathscript
[Wednesday Apr 17 14:16:24 2002] [warn] [client 192.168.0.6] [AxKit]
xs_get_styles returned: , , dromedaries
[Wednesday Apr 17 14:16:24 2002] [warn] [client 192.168.0.6] [AxKit]
Calling GetMatching Processors with (screen, , , , dromedaries)
[Wednesday Apr 17 14:16:24 2002] [warn] [client 192.168.0.6] [AxKit]
get_styles: loading style modules
[Wednesday Apr 17 14:16:24 2002] [warn] [client 192.168.0.6]
[AxKit] get_styles: looking for mapping for style type: 'application/x-xpathscript'
[Wednesday Apr 17 14:16:25 2002] [warn] [client 192.168.0.6]
[AxKit] cache doesn't exist
[Wednesday Apr 17 14:16:25 2002] [warn] [client 192.168.0.6]
[AxKit] some condition failed. recreating output
[Wednesday Apr 17 14:16:25 2002] [warn] [client 192.168.0.6]
[AxKit] styles: Apache::AxKit::Language::XPathScript(test.xps)
[Wednesday Apr 17 14:16:25 2002] [warn] [client 192.168.0.6]
[AxKit] [uri] File Provider looking up uri test.xps
[Wednesday Apr 17 14:16:25 2002] [warn] [client 192.168.0.6]
[AxKit] [uri] File Provider set filename to /usr/local/apache/htdocs/test.xps
[Wednesday Apr 17 14:16:25 2002] [warn] [client 192.168.0.6]
[AxKit] about to execute: Apache::AxKit::Language::XPathScript::handler
[Wednesday Apr 17 14:16:25 2002] [warn] [client 192.168.0.6]
[AxKit] XPathScript: Getting XML Source
[Wednesday Apr 17 14:16:25 2002] [warn] [client 192.168.0.6]
[AxKit] XPathScript: reparsing file
[Wednesday Apr 17 14:16:25 2002] [warn] [client 192.168.0.6]
[AxKit] Checking stylesheet mtime: 1019064044
[Wednesday Apr 17 14:16:25 2002] [warn] [client 192.168.0.6]
[AxKit] Recompiling stylesheet: /usr/local/apache/htdocs/test.xps
[Wednesday Apr 17 14:16:25 2002] [warn] [client 192.168.0.6]
[AxKit] XPathScript: extracting from '/usr/local/apache/htdocs/test.xps' contents: <%
$t->{'humps'}{'pre'} = "<td>";
$t->{'humps'}{'post'} = "</td>";
$t->{'disposition'}{'pre'} = "<td>";
$t->{'disposition'}{'post'} = "</td>";
$t->{'species'}{testcode} = sub {
my $node = shift;
my $t = shift;
$t->{pre} = '<tr><td>' . findvalue('@name', $node) . '</td>';
$t->{post} = "</tr>";
return 1;
}
%>
<html>
<head>
<title>Know Your Dromedaries</title>
</head>
<body bgcolor="white">
<table bgcolor="eeeeee" border="1">
<tr><th>Species</th><th>No. of Humps</th><th>Disposition</th></tr>
<%= apply_templates('/dromedaries/species') %>
</table>
</body>
</html>
[Wednesday Apr 17 14:16:25 2002] [warn] [client 192.168.0.6]
[AxKit] Compiling script: package
Apache::AxKit::Language::XPathScript::ROOT::usr::local::apache::htdocs::test_2exps;
use Apache qw(exit);use
XML::XPath::Node;Apache::AxKit::Language::XPathScript::Toys->import;sub handler {my
($r, $xp, $t) = @_;
#line 1 /usr/local/apache/htdocs/test.xps
print q||;
#line 1 /usr/local/apache/htdocs/test.xps
$t->{'humps'}{'pre'} = "<td>";
$t->{'humps'}{'post'} = "</td>";
$t->{'disposition'}{'pre'} = "<td>";
$t->{'disposition'}{'post'} = "</td>";
$t->{'species'}{testcode} = sub {
my $node = shift;
my $t = shift;
$t->{pre} = '<tr><td>' . findvalue('@name', $node) . '</td>';
$t->{post} = "</tr>";
return 1;
};
print q|
<html>
<head>
<title>Know Your Dromedaries</title>
</head>
<body bgcolor="white">
<table bgcolor="eeeeee" border="1">
<tr><th>Species</th><th>No. of Humps</th><th>Disposition</th></tr>
|;
#line 22 /usr/local/apache/htdocs/test.xps
print(do { apply_templates('/dromedaries/species') });
print q|
</table>
</body>
</html>
|;
}
[Wednesday Apr 17 14:16:25 2002] [warn] [client 192.168.0.6]
[AxKit] Running XPathScript script
[Wednesday Apr 17 14:16:25 2002] [warn] [client 192.168.0.6]
[AxKit] execution of: Apache::AxKit::Language::XPathScript::handler finished
[Wednesday Apr 17 14:16:25 2002] [warn] [client 192.168.0.6]
[AxKit] Cache: key = d3c83b 9cdf2083f7ab5b5a2bbfbd0717
[Wednesday Apr 17 14:16:25 2002] [warn] [client 192.168.0.6]
[AxKit] [Cache] writing cache file
/var/tmp/axkit_cache//d3/c8/3b9cdf2083f7ab5b5a2bbfbd0717
[Wednesday Apr 17 14:16:25 2002] [warn] [client 192.168.0.6]
[AxKit] sending custom response: 200
--
Nate, UNIX System Administrator and (new) AxKit User
axkit-user + at + noopy.org
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]