Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2004-10-08
5
Medium Priority
?
1,039 Views
Last Modified: 2013-11-18
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>";
?>
0
Comment
Question by:jpegvarn
  • 2
  • 2
5 Comments
 
LVL 15

Expert Comment

by:dualsoul
ID: 12272397
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?
0
 
LVL 6

Expert Comment

by:sathishv
ID: 12274411
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.
0
 

Author Comment

by:jpegvarn
ID: 12275576
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.
0
 
LVL 6

Accepted Solution

by:
sathishv earned 2000 total points
ID: 12275737
What about write permissions for the folder in which you expect the file to get created?
0
 

Author Comment

by:jpegvarn
ID: 12275886
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!
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL several years ago, it seemed like now was a good time to update it for object-oriented PHP.  This article does that, replacing as much as possible the pr…
Create a Windows 10 custom Image with custom task bar and custom start menu using XML for deployment.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

972 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question