note 74003 deleted from function.xslt-create by sobak

From: Date: Thu, 24 Nov 2016 11:52:45 +0000
Subject: note 74003 deleted from function.xslt-create by sobak
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-207551@lists.php.net to get a copy of this message
Note Submitter: myadzel at gmail dot com ---- All for a long time know about a problem xslt-transformation in php. We shall try a trivial way, knowing, that xslt_process () accepts string or resources in it's parameters. function xslt ($xml, $xsl) { $xh = @xslt_create(); $args['xml'] = join ('', file ($xml)); $args['xsl'] = join ('', file ($xsl)); // try with a string $result = @xslt_process ($xh, 'arg:/xml', 'arg:/xsl', NULL, $args); // try with resource if (!$result) { $result = @xslt_process ($xh, $xml, $xsl); } @xslt_free ($xh); return $result; } For example: echo xslt ('./index.xml', './index.xsl');

« previous php.notes (#207551) next »