Jenda has asked for the wisdom of the Perl Monks concerning the following question:

Update: SOLVED! The problem was (as usual) permissions. The web user did have enough permissions to create the XML that I wanted to process, but it did not have permissions to LIST the files in that temp directory. And therefore -e $source failed even though open IN, '<', $source worked.

I ended up making a copy of the XML into a subdirectory created by the web user where I could proces it without any problems.
/Update

I'm trying to use the XML::LibXSLT to do some XML->HTML transformation. If I try it as myself, everything works correctly, if I try the same code, with the same XML and the same template via web, the $Stylesheet->transform_file($source) dies with "Error applying stylesheet: (get error out of libxslt)". Jolly good, but HOW? How am I supposed to get the error? The docs dot even mention errors.

And does anyone have any idea what could be wrong? The web user does have premissions to the XML and template files, to the libxml2.dll, libxslt_win32.dll, libexslt_win32.dll, the perl libraries, ... I'm using Perl 5.8.0 ActivePerl 805, XML::LibXSLT 1.53, XML::LibXML 1.56, under Win2k server and IIS/5.0. The code is inside a COM dll created by PerlCtrl 5.1.0 build 510.

Thanks, Jenda
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.
   -- Rick Osborne

Replies are listed 'Best First'.
Re: XML::LibXSLT and "Error applying stylesheet: (get error out of libxslt)"
by PodMaster (Abbot) on Nov 24, 2003 at 23:08 UTC
    Is $source an absolute path?

    Have you tried setting a debug_callback?

    Try Node XML to HTML and see if that works (worked for me).

    MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
    I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
    ** The third rule of perl club is a statement of fact: pod is sexy.

      Yes, the path is absolute :-)

      The callback doesn't seem to get called.

      The code looks like this (with lots of stuff snipped)

      use XML::LibXSLT; #... $XSLT = XML::LibXSLT->new(); $Stylesheet = $XSLT->parse_stylesheet_file($path) or die "Failed to parse the template.\n"; #... XML::LibXSLT->debug_callback(\&logmsg); my $results = eval { $Stylesheet->transform_file($source) }; if ($@) { die "LibXSLT died with: $@\nDebug info: $debug"; } $Stylesheet->output_file($results, $dest); #...
      You can see the whole source of the Perl DLL here.

      The VB code (don't ask) that calls the object looks like this:

      ' ... Dim XSLT As Object, StyleSheet As Variant Set XSLT = CreateObject("Viper.XSLTransform") StyleSheet = "http://xsl.tmp.de/Jobpilot.de/tmpw-1.0.xsl" If XSLT.LoadTemplate(StyleSheet) Then XSLT.TransformFile tempFilename, tempFilename & ".tmp" ' ...
      where tempFilename is an absolute path to a file that was just created.

      Thanks, Jenda
      Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.
         -- Rick Osborne

      Edit by castaway: Closed small tag in signature