Hi all,

I'm trying to use an XPathScript stylesheet to process the <filelist>
generated by AxKit when "AxHandleDirs On" is specified.

I'm still in the testing phase at the moment, so I have the following
noddy .xps file that I'm working with.

    <html>
      <body>
        <p><% print 'hello world'; %></p>
      </body>
    </html>

If I put this in a file ('s.xps'), and then have a test XML file
('t.xml')

    <?xml version="1.0"?>
    <?xml-stylesheet type="application/x-xpathscript" href="t.xps"?>
    <foo></foo>

and request t.xml from my browser I get back the correct HTML ('hello
world').  So I know that AxKit is installed and processing the .xps
properly in this instance.

For sanity's sake, I also have a simple XSLT file ('s.xsl') which looks
like this:

    <html xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
          xsl:version="1.0">
      <body><p>Hello world</p></body>
    </html>

and if I change the type and href attributes in t.xml to refer to s.xsl
and request it through the browser AxKit styles it using s.xsl (verified
by checking the http logs with 'AxDebugLevel 10').

If I tell AxKit to use s.xsl to process the <filelist> element when
AxHandleDirs is On it does the right thing.  With this config file
fragment:

    AxHandleDirs On

    AxAddRootProcessor text/xml /path/to/s.xsl \
        {http://axkit.org/2002/filelist}filelist

If I request the directory index by passing a URL with a trailing '/' I
get back 'hello world', generated by s.xsl.

If I follow the docs, I should be able to use XPathScript instead, by
doing this:

    AxAddRootProcessor application/x-xpathscript /path/to/s.xps \
        {http://axkit.org/2002/filelist}filelist

However, this generates an error.

The appropriate chunk of the error log is as follows:

--------

[AxKit] Generated file list: <?xml version="1.0" encoding="UTF-8"?>
... generated file list shown, looks fine ...
... misc debug info ...
[AxKit] styles: Apache::AxKit::Language::XPathScript(/nik/s.xps)
[AxKit] Style Provider Override: Apache::AxKit::Provider::File
[AxKit] [uri] File Provider looking up uri /nik/s.xps
[AxKit] [uri] File Provider set filename to /home/nik/test/s.xps
[AxKit] about to execute: Apache::AxKit::Language::XPathScript::handler
[AxKit] XPathScript: Getting XML Source
[AxKit] XPathScript: reparsing file
[AxKit] Provider get_ext_ent_handler for file:///dev/null
[AxKit] Content Provider Override: Apache::AxKit::Provider::File
[AxKit] decoding from UTF-8
[AxKit] [req] File Provider given $r: /usr/local/www/htdocs/file:
[AxKit] encoding to UTF-8
[AxKit] Caught an exception
[AxKit] [UnCaught] File '/usr/local/www/htdocs/file:' does not exist or
        is not readable
[AxKit] [Backtrace] File '/usr/local/www/htdocs/file:' does not exist or
        is not readable at /usr/local/lib/perl5/site_perl/5.6.1/Error.pm line 147
        Error::throw('Apache::AxKit::Exception::IO', '-text', 'File 
\'/usr/local/www/htdocs/file:\' does not exist or is not re...') called at 
/usr/local/lib/perl5/site_perl/5.6.1/mach/Apache/AxKit/Provider/File.pm line 202
        
Apache::AxKit::Provider::File::get_fh('Apache::AxKit::Provider::File=HASH(0x8330a18)') 
called at /usr/local/lib/perl5/site_perl/5.6.1/mach/A pache/AxKit/Provider/File.pm 
line 226
        
Apache::AxKit::Provider::File::get_strref('Apache::AxKit::Provider::File=HASH(0x8330a18)')
 called at /usr/local/lib/perl5/site_perl/5.6.1/mach/Apache/AxKit/Provider.pm line 116
        Apache::AxKit::Provider::__ANON__('XML::Parser::Expat=HASH(0x8368460)', undef, 
'file:///dev/null', '-//AXKIT/FileList XML V1.0//EN') called at 
/usr/local/lib/perl5/site_perl/5.6.1/mach/XML/Parser/Expat.pm line 474
        XML::Parser::Expat::parse('XML::Parser::Expat=HASH(0x8368460)', '<?xml 
version="1.0" encoding="UTF-8"?>^J<!DOCTYPE filelist PUBLIC...') called at 
/usr/local/lib/perl5/site_perl/5.6.1/mach/XML/Parser.pm line 185
        eval {...} called at /usr/local/lib/perl5/site_perl/5.6.1/mach/XML/Parser.pm 
line 184
        XML::Parser::parse('XML::Parser=HASH(0x835a27c)', '<?xml version="1.0" 
encoding="UTF-8"?>^J<!DOCTYPE filelist PUBLIC...') called at /usr/loc 
al/lib/perl5/site_perl/5.6.1/XML/XPath/XMLParser.pm line 75
        XML::XPath::XMLParser::parse('XML::XPath::XMLParser=HASH(0x8413e94)', '<?xml 
version="1.0" encoding="UTF-8"?>^J<!DOCTYPE filelist PUBLIC...') called at 
/usr/local/lib/perl5/site_perl/5.6.1/mach/Apache/AxKit/Language/XPathScript.pm line 141
        
Apache::AxKit::Language::XPathScript::get_source_tree('Apache::AxKit::Provider::File=HASH(0x82d233c)',
 'XML::XPath::XMLParser=HASH(0x8413e94)') called at 
/usr/local/lib/perl5/site_perl/5.6.1/mach/Apache/AxKit/Language/XPathScript.pm line 68
        
Apache::AxKit::Language::XPathScript::handler('Apache::AxKit::Language::XPathScript', 
'AxKit::Apache=SCALAR(0x82d2240)', 'Apache::AxKit::Provider::File=HASH(0x82d233c)', 
'Apache::AxKit::Provider::File=HASH(0x832edb0)', 1) called at 
/usr/local/lib/perl5/site_perl/5.6.1/mach/AxKit.pm line 634
        AxKit::process_request('AxKit::Apache=SCALAR(0x82d2240)', 
'Apache::AxKit::Provider::File=HASH(0x82d233c)', 'ARRAY(0x82a2f00)') called at 
/usr/local/lib/perl5/site_perl/5.6.1/mach/AxKit.pm line 458
        AxKit::run_axkit_engine('AxKit::Apache=SCALAR(0x82d2240)', 
'Apache::AxKit::Provider::File=HASH(0x82d233c)') called at 
/usr/local/lib/perl5/site_perl/5.6.1/mach/AxKit.pm line 285
        eval {...} called at /usr/local/lib/perl5/site_perl/5.6.1/mach/AxKit.pm line 
276
        AxKit::main_handler('AxKit::Apache=SCALAR(0x82d2240)', 
'Apache::AxKit::Provider::File=HASH(0x82d233c)') called at 
/usr/local/lib/perl5/site_perl/5.6.1/mach/AxKit.pm line 193
        AxKit::fast_handler('AxKit::Apache=SCALAR(0x82d2240)') called at /dev/null 
line 0 eval {...} called at /dev/null line 0

---------

If I use the s.xsl file then the following is logged (and, as I say,
everything works as it should).

--------
[AxKit] styles: Apache::AxKit::Language::LibXSLT(/nik/s.xsl)
[AxKit] Style Provider Override: Apache::AxKit::Provider::File
[AxKit] [uri] File Provider looking up uri /nik/s.xsl
[AxKit] [uri] File Provider set filename to /home/nik/test/s.xsl
[AxKit] about to execute: Apache::AxKit::Language::LibXSLT::handler
[AxKit] [LibXSLT] getting the XML
[AxKit] LibXSLT match_uri: file:///dev/null
[AxKit] [LibXSLT] parsing stylesheet
[AxKit] [LibXSLT] parsing stylesheet /nik/s.xsl
[AxKit] [LibXSLT] performing transformation
[AxKit] Apache::AxKit::Language::LibXSLT::handler finished with code 0
[AxKit] execution of: Apache::AxKit::Language::LibXSLT::handler finished
[AxKit] writing xml string to browser
--------

Bug?

N
-- 
FreeBSD: The Power to Serve      http://www.freebsd.org/               (__)
FreeBSD Documentation Project    http://www.freebsd.org/docproj/    \\\'',)
                                                                      \/  \ ^
   --- 15B8 3FFC DDB4 34B0 AA5F  94B7 93A8 0764 2C37 E375 ---         .\._/_)

Attachment: msg02298/pgp00000.pgp
Description: PGP signature

Reply via email to