Solved

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

Posted on 2004-10-08
5
1,030 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

CHALLENGE LAB: Troubleshooting Connectivity Issues

Goal: Fix the connectivity issue in the lab's AWS environment so that you can SSH into the provided EC2 instance.  

Question has a verified solution.

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

Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Suggested Courses

617 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