Solved

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

Posted on 2004-10-08
5
1,014 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 500 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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Shoutout to Emily Plummer (http://www.experts-exchange.com/members/eplummer26.html) for giving me this article! She did most of it, I just finished it up and posted it for her :)    Introduction In a previous article (http://www.experts-exchang…
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

707 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now