I am using the sablotron xslt library I just want to make a class to
minimize the code I need to write and make it easier to maintain.
When I do it like so:
// create XSLT processor
$xh = xslt_create();
// call xslt processor
// Process the document
$result = xslt_process($xh, 'arg:/_xml', $xmldoc->xslstr, NULL,
$arguments);
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($xh)
.
print " and the error code is " . xslt_errno($xh);
}
xslt_free($xh);
it works fine. I just don't seem to be able to make it work in a class.
On Wed, 2002-09-11 at 14:18, Brian V Bonini wrote:
> Isn't this what the salbatron library is for?
>
> > -----Original Message-----
> > From: Geoff [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, September 11, 2002 2:52 PM
> > To: php list
> > Subject: [PHP] help with making an xslt class
> >
> >
> > 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
> >
> >
> >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php