note 9843 modified in xslt_transform by ronabop
| From: | ronabop@php.net | Date: | Wed, 06 Dec 2000 05:41:40 +0000 |
| Subject: | note 9843 modified in xslt_transform by ronabop | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-8438@lists.php.net to get a copy of this message | ||
the syntax for the first example is wrong, and the second sample is a bit misleading.
The $xsl and $xml arguments for xslt_transform() are *URI's*, not strings of xml data.
using strings of xml data will stop script execution and give this error:
Error [code:237]
unsupported URI scheme '<?xml version="1.0"?>
<xsl'....
here is the sample code from my enhanced version of the XSLTransformer wrapper class (originally by
Justin Grant, from an article on phpbuilder.com). my version added support for this function, and is
available here:
http://www.subpop.com/~dietricha/php_sablot.zip
<?
include "../classes/class.XSLTransformer.php";
$params = array("display" => "category");
$xslt = new XSLTransformer();
$xslt->setVars('api.xsl','api_domxml.xml',$params);
if($xslt->xslt_transform()){
echo $xslt->getOutput();
} else {
echo $xslt->getError();
}
?>
http://www.php.net/manual/function.xslt-transform.php