-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Marc,
(I'm also cc'ing the dev list that more people can get help from your question and hopefully my answer) no TomKit is not an PerlResponseHandler it works in 2 Phases: a) Fixup (b) PerlResponse) c) OutputFilter An example configuration can be found at: t/conf/extra.conf.in but it looks something like this: - -----------------------8<----------------------- <Location /xslt/base.xml> ~ PerlFixupHandler Apache2::TomKit ~ PerlSetVar AxAddProcessorDef "text/xsl=>xslt/base.xsl" ~ PerlSetVar AxAddProcessorMap "text/xsl=>Apache2::TomKit::Processor::LibXSLT" </Location> <Location /xslt/chain.xml> ~ PerlFixupHandler Apache2::TomKit ~ PerlAddVar AxAddProcessorDef "text/xsl=>xslt/base.xsl" ~ PerlAddVar AxAddProcessorDef "text/xsl=>xslt/chain.xsl" ~ PerlSetVar AxAddProcessorMap "text/xsl=>Apache2::TomKit::Processor::LibXSLT" </Location> - -----------------------8<----------------------- Please also note that TomKit doesn't come yet with an replacement to XSP ~ and it has until now a very low priotrity on my task list for an AxKit2 (still the more people require it the higher the priority gets). We want to provide all things people can do with XSP now using libxslts-register_function calls but that's another story, still without the help of the original authors of these modules I'm afraid that it will take a long time to understand how they are working. Your xsp:expr example can be simply done using register_function of LibXSLT. I'm not sure but I think the actual implementation of XML::LibXSLT::Enhanced has already hooks to use something like this. I'll show you how to use it as soon as possible but it may take one or two days. Some comments are inline! Tom Marc-Andre Landry schrieb: | Hello Tom, | I haven't understand how you've added TomKit to @INC. I tried the | proposition at | http://perl.apache.org/docs/2.0/user/intro/start_fast.html for Module | Handler. I have set up a startup.pl script in my working path : | /var/www/perl (with access for httpd2). Well your solution is the smarter one. I simply linked my TomKit modules to the global perl-path. | | ------- startup.pl ------- | use lib qw(/var/www/perl); | 1; | -------------------------- | | I made cp -r TOMKIT_HOME/lib/Apache2 /var/www/perl/Apache2 to have a | full copy of the solution. | shouldn't have this been: cp -r TOMKIT_HOME/lib/Apache2/* /var/www/perl/Apache2. If I'm not completely wrong the result of your command is be a path something like this: /var/www/perl/Apache2 /var/www/perl/Apache2/Apache2 /var/www/perl/Apache2/Apache2/TomKit That's one Apache2 too much else everything should work using your aproach. | Then I add this to my site configuration that just look like this except | for path location that I snipped out : | | -------------------------- | NameVirtualHost *:80 | <VirtualHost *:80> | ServerAdmin xeno AT videotron.ca | | DocumentRoot "path_to_website" | <Directory /> | Options FollowSymLinks | AllowOverride None | </Directory> | <Directory "path_to_website"> | Options Indexes FollowSymLinks MultiViews | AllowOverride None | Order allow,deny | allow from all | | SetHandler perl-script | PerlResponseHandler Apache2::Tomkit | </Directory> | | # TomKit Configuration | PerlRequire /var/www/perl/startup.pl | | ErrorLog /var/log/apache2/error.log | # Possible values include: debug, info, notice, warn, error, crit, | # alert, emerg. | LogLevel debug | CustomLog /var/log/apache2/access.log combined | | ServerSignature On | | </VirtualHost> | -------------------------- | | I made this index.xsp for testing purpose that I put in the root | directory of my path_to_website : | -------------------------- | <xsp:page | xmlns:xsp="http://apache.org/xsp/core/v1" | xmlns="uri://axkit.org/NS/MyHomePage" | language="Perl"> | <page> | <body> | <heading>Hello World</heading> | It is now: <xsp:expr>scalar localtime</xsp:expr> | </body> | </page> | </xsp:page> | -------------------------- | | Then I tried my http://localhost/ & receaved error 500. Should I put the | PerlRequire before any other call of mod_perl like SetHandler & | PerlResponseHandler? I'm sure I have done something wrong but can't | figure it. | | My error log say this : | -------------------------- | [Sun Jun 26 09:32:44 2005] [error] [client 127.0.0.1] failed to resolve | handler `Apache2::Tomkit': Can't locate Apache2/Tomkit.pm in @INC (@INC | contains: /var/www/perl /etc/perl /usr/local/lib/perl/5.8.7 | /usr/local/share/perl/5.8.7 /usr/lib/perl5 /usr/share/perl5 | /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl . | /etc/apache2) at (eval 5) line 3.\n | -------------------------- | | Regards, | Marc-Andre | | Tom Schindl wrote: | |> -----BEGIN PGP SIGNED MESSAGE----- |> Hash: SHA1 | | [...] | |> The installation problem I said is not that big. The following should |> work for now depending where your perl5-lib and tomkit sources reside: |> |> In my case: |> $LIB_PERL5 = /opt/perl-tomkit/lib |> $TOMKIT_HOME = /home/tom/workspace/TomKit |> |> - --------------------------------------- |> cd $LIB_PERL5/site_perl/5.8.6 |> mkdir Apache2 |> cd Apache2 |> ln -s $TOMKIT_HOME/lib/Apache2/T* . |> - --------------------------------------- |> |> Documentation is something very important and there more you can collect |> the better it is. Still the installation process should be straight |> forward when the module leaves the early alpha-stages. |> |> Tom | | | -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFCv587kVPeOFLgZFIRArd8AJ9CFgMjjiWHwW2R+0B9rOltV5Hg/wCgiidf FxgV6njqjZnFFKkuUx/hhmM= =Ku3Q -----END PGP SIGNATURE-----