Link to home
Start Free TrialLog in
Avatar of jpegvarn
jpegvarnFlag for United States of America

asked on

Saxon Processor --> PHP, XML, XSL output to Excel file

Hello,

I have the Saxon processor installed on my machine and on the command line works great for getting an XML file using XSL to output to an Excel file.  Now, I need to get it to work through my PHP script.  If I can somehow get some code that will create the excel file from running the php script, that will be a great step forward.  Below is my latest attempt, but it is not outputting the excel file.  Please help, thanks.

<?php
      $output = exec('java -jar ./saxon/saxon.jar ./saxon/newfile.xml ./saxon/2excel.xsl');
      echo "<pre>$output</pre>";
?>
Avatar of dualsoul
dualsoul

hm...can .... i'm not sure i understood what the problem is?

you can't start Saxon from PHP? or you do that, but no output file is created? Is it all right with access rights?

by the way, why are you using Saxon for Java on PHP? why not Sablotron?
Where do you expect the output file to be created? You might have rights problem. If I remember correctly there is an option in Saxon to set the output directory, or it can be passed as a parameter and accessed in XSL.
Avatar of jpegvarn

ASKER

Hi Guys...and thank you for the replies,

The problem is there is no output.  I expect the excel file to be created within the same folder as where I am executing the test.php file.

If I run the same command at a command prompt, that is what happens.  I did give the 'Internet Guest Account' read/read & execute permissions to cmd.exe.  I am ultimatley trying to get the command to run from the browser, then the user will be prompted to save the excel file to their dekstop.

dualsoul - if you highly recommend Sablotron, could you give me a quick and dirty example of how I can use it?

Thank you.
ASKER CERTIFIED SOLUTION
Avatar of sathishv
sathishv

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I can not believe I didn't think of that!  That was it, thank you.  Points awarded.

Quick question if you don't mind - I am testing this on a Windows machine and will ultimatley be moving everything over to a freebsd machine.  What is the "Internet Guest Account" called for freebsd/unix and what chmod should I be using on the folders?  Thank you!