note 74003 added to function.xslt-create
| From: | myadzel at gmail dot com | Date: | Tue, 20 Mar 2007 16:26:59 +0000 |
| Subject: | note 74003 added to function.xslt-create | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-124629@lists.php.net to get a copy of this message | ||
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');
----
Server IP: 195.54.192.44
Probable Submitter: 212.248.25.34
----
Manual Page -- http://www.php.net/manual/en/function.xslt-create.php
Edit -- https://master.php.net/note/edit/74003
Del: integrated -- https://master.php.net/note/delete/74003/integrated
Del: useless -- https://master.php.net/note/delete/74003/useless
Del: bad code -- https://master.php.net/note/delete/74003/bad+code
Del: spam -- https://master.php.net/note/delete/74003/spam
Del: non-english -- https://master.php.net/note/delete/74003/non-english
Del: in docs -- https://master.php.net/note/delete/74003/in+docs
Del: other reasons-- https://master.php.net/note/delete/74003
Reject -- https://master.php.net/note/reject/74003
Search -- https://master.php.net/manage/user-notes.php