Connecting Tech Pros Worldwide Forums | Help | Site Map

Generate xsl file with php

Lorenzo De Tomasi
Guest
 
Posts: n/a
#1: Jul 5 '08
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