Connecting Tech Pros Worldwide Help | Site Map

Generate xsl file with php

  #1  
Old July 5th, 2008, 02:25 PM
Lorenzo De Tomasi
Guest
 
Posts: n/a
With php, is it possible to generate an xslt (.xsl) file and then,
always with php, parse an xml file using the php-generated xsl file?

The problem is: can I create a localized xsl file based on php-gettext
and then parse the xml file loading the xsl file in the correct
language?

Something like:
$doc = new DOMDocument();
$xsl = new XSLTProcessor();
$doc->load('template.xsl?lang=it');
$xsl->importStyleSheet($doc);
$doc->load('it.xml');
echo $xsl->transformToXML($doc);

Thank you :-)
Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP code from XSL won't execute Dormilich answers 1 September 5th, 2008 12:07 PM
web app with php, xml, xsl, css petermichaux@yahoo.com answers 7 July 17th, 2005 02:47 PM
xslt transformation with php Sergio del Amo answers 0 July 17th, 2005 04:00 AM
PHP & XML (again) David answers 5 July 16th, 2005 11:50 PM