help with making an xslt class
| From: | Geoff | Date: | Wed, 11 Sep 2002 18:52:02 +0000 |
| Subject: | help with making an xslt class | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-116020@lists.php.net to get a copy of this message | ||
I am trying to make a class to process xslt transformations.
Here is the class:
class xslTransformer extends makexml {
var $xh;
function xslTransformer($xslfile) {
$this->xh = xslt_create();
$result=xslt_process($this->xh,$this->xmlstr,$xslfile); //errors if
($result) {
print $result;
}
else {
print "Sorry, the xml could not be transformed by the xsl into"; print
" the \$result variable the reason is that . "xslt_error($this->xh) .
print " and the error code is " . xslt_errno($this->xh);
}
xslt_free($this->xh);
}
}
I call it as
$this->xmlstr is valid xml (I have checked) the makexml class works fine
as well.
Here is the error I get:
Warning: Sablotron error on line 1: XML parser error 3: no element found
in /usr/lib/apache/htdocs/xml/clsmakexml.php on line 200
Sorry, the xml could not be transformed by the xsl into and the error
code is 2 the $result variable the reason is that XML parser error 3: no
element found