Just some thoughts for those using Sablotron with PHP.

  In my quite complex Apache configuration I have:
- mod_perl (for faster Perl scripts execution and AxKit for XML serving),
- mod_ssl (for calling OpenSSL and having secure connections),
- mod_php (for PHP scripts).

  Now, it all works fine only if:
- I use location configuration directives (like Files, Location, ...) for
serving XML files and set AxKit as a perl-handler in that location
- I compile Apache statically (because of mod_ssl exiting abnormally when
added as a dynamic module)
- I compile PHP without XML support (e.g. --disable-xml option with PHP4
else it will enable XML support by default - that means if PHP4 is compiled
as an Apache module it will use expat support built in Apache 1.3.9+ and if
PHP is compiled as CGI executable then it has to find expat on the library
path).

  I think the last line is crucial for this config but maybe for plain
Apache/PHP/Sablotron configuration too. Sablotron calls expat (XML parser)
compiled standalone and not an Apache built-in copy of expat when
compiled/enabled with PHP as I understand all. Having XML support enabled in
PHP can cause problems but you might be lucky :-). Usually configuration
directives --with-expat (hmm, this is not in the official PHP
docs), --with-sablot and possibly --with-dom (this requires GNOME XML
library) will work.

  And to give you some practical files, I've checked PHPBuilder's article
http://www.phpbuilder.com/columns/justin20001025.php3
- Transforming XML with XSL using Sablotron
  which works (I guess) for PHP3, then grabbed revised version for PHP4 from
http://www.circle.ch/scripts/
  and added Unicode support as suggested from Axel Tietje
http://www.phpbuilder.com/annotate/message.php3?id=1002147
  with changes to work with PHP4 so this should now work for all who have
PHP4 and Sablotron installed:

http://sergej.rinc.ws/xml/slashdotphpxsl.zip
  Unzip the archive into your webserver subdir, then call xlst.php or
unicodexslt.php from your browser. It should open on-the-fly created
Slashdot news page if all is OK.

  Gee, and all this just took me half an hour (not counting rebuilding PHP
and Apache).

  Hope this helps PHP-ers,
Sergej Rinc, Certified Doc-To-Help Trainer
Master XML, Master XSL, Master WAP
Member, International Webmasters Association http://iwanet.org
mailto:[EMAIL PROTECTED], http://sergej.rinc.ws

Reply via email to