0

I am using EasyPHP for test purposes, and I wish to apply an XSLT 2.0 processor in my php code. EasyPHP 5.3.9 standard xslt processor is of 1.0 version though.

What do I have to do to apply the xslt processor in Saxon9he.jar or XSLT2Processor.jar (found on sourceforge.net)? Stuff I would like to know:

  • which directory to place the jar in
  • where to change config to include the jar (probably using extension functionality)
  • what to put into code in order to declare new instance of xslt processor

Code I am currently using

<?php
    $XML = new DOMDocument();
    $XML->load('test.xml');
    $xslt = new XSLTProcessor();
    $XSL = new DOMDocument();
    $XSL->load('test.xslt');
    $xslt->importStylesheet( $XSL );
    print $xslt->transformToXML( $XML );
?>

which errors because I have an XSLT 2.0 version stylesheet. The errors I get are like

Warning: XSLTProcessor::importStylesheet() [xsltprocessor.importstylesheet]: compilation error: file file:///C:/Program%20Files%20(x86)/EasyPHP-5.3.9/www/test.xslt line 99 element function in C:\Program Files (x86)\EasyPHP-5.3.9\www\test.php on line 7
Maestro13
  • 3,656
  • 8
  • 42
  • 72
  • http://www.saxonica.com/documentation/about/installationjava.xml – Dimitre Novatchev Jun 13 '12 at 12:14
  • Also see: http://www.saxonica.com/documentation/samples/trax.xml and http://www.saxonica.com/documentation/samples/jdom.xml – Dimitre Novatchev Jun 13 '12 at 12:17
  • @DimitreNovatchev Where's the link to EasyPHP or even php scripting? – Maestro13 Jun 13 '12 at 17:17
  • Maestro13: Your questions are about how to install and use Saxon -- I provided the relevant documentation links. It is up to you how to use this information. – Dimitre Novatchev Jun 13 '12 at 17:23
  • @DimitreNovatchev My questions are on how to integrate saxon (or other java jars) into EasyPHP. – Maestro13 Jun 13 '12 at 18:14
  • Maestro13: If this is the case, I doubt this question falls into the "xslt" tag. I thought that from PHP (which I am completely ignorant of) one can somehow execute any Java program, including Saxon. As you see, an XSLT specialist or even the developer of Saxon himself maynot be of any help in answering this PHP question. – Dimitre Novatchev Jun 13 '12 at 19:32

0 Answers0