<?php $xsl_filename='xslt.xsl'; $xml_filename='liste.xml'; $xsl = new XSLTProcessor(); $xsldoc = new DOMDocument(); $xsldoc->load($xsl_filename); $xsl->importStyleSheet($xsldoc); $xmldoc = new DOMDocument(); $xmldoc->load($xml_filename); echo $xsl->transformToXML($xmldoc); ?>
download sous [1] j'ai pris la 2.7.1 : http://archive.apache.org/dist/xml/xalan-j/xalan-j_2_7_1-bin.zip
J'ai créé le fichier xalan.bat
@echo off @java -classpath "c:\Program Files\xalan-j_2_7_1\serializer.jar" -classpath "c:\Program Files\xalan-j_2_7_1\xercesImpl.jar" -classpath "c:\Program Files\xalan-j_2_7_1\xml-apis.jar" -classpath "c:\Program Files\xalan-j_2_7_1\xalan.jar" org.apache.xalan.xslt.Process %*
J'ai du augmenter la stack option -Xss1m à ajouter a java
@java -Xss1m ...
exemple d'utilisation
"C:\Program Files\xalan-j_2_7_1\xalan.bat" -in "G:\sites free\site free JLT\testphp\xslt\liste.xml" -xsl "G:\sites free\site free JLT\testphp\xslt\xslt.xsl"