Hallo,
ich rufe erfolgreich folgende Umwandlung auf:
Das Problem besteht darin, dass ich den Pfad hinter der Variable "correct_file" per "getPublicationFolder()" an das XSL übergeben muss, damit es andere Ziele finden kann. Dies mache ich so:
Leider erscheint nun die Fehlermeldung:
Ich habe schon gegoogelt und finde im Forum leider nur andere Themen zu registerPHPFunctions. Wäre für jede Hilfe dankbar.
LG Dom
ich rufe erfolgreich folgende Umwandlung auf:
PHP Code:
$xsl = simplexml_load_file('../xsl/correct.xsl');
$xml = simplexml_load_file('./pub/' . $this->correct->correct_file . '/Spreads/Spread_u14d.xml');
function getPublicationFolder() {
return $this->correct->correct_file;
}
//XSLT Process
$xslt = new XSLTProcessor;
$xslt->registerPHPFunctions($xsl);
$xslt->importStyleSheet($xsl);
echo '<div>'.$xslt->transformToXML($xml).'</div>';
Code:
<xsl:variable name="pubID"> <xsl:value-of disable-output-escaping="yes" select="php:function('getPublicationFolder', string())"/> </xsl:variable>
Code:
Warning: XSLTProcessor::transformToXml(): Not allowed to call handler 'getPublicationFolder()'
LG Dom
Comment