PDA

View Full Version : apache/xsltprocessor not working?!


angst
06-08-2009, 10:13 PM
Hello, I'm trying to get libxslt to work with apache ( on ubuntu ) so I can run importStylesheet with xml Dom.

I maybe missing something here, but I can't seem to make this work, I just want to installed the style sheet into the xml docs that I'm creating with the dom object. any help or pointers would be great!

cheers,
-Ken


my code:

$doc = new DomDocument('1.0');
$root = $doc->createElement('root');
$root = $doc->appendChild($root);

// create node, add value
$occ = $root->appendChild($doc->createElement("test"));
$occ->appendChild($doc->createTextNode("242"));

$dom = new DOMDocument();
$dom->loadXML($doc->saveXML());

$proc = new xsltprocessor();
$proc->importStylesheet( 'style.xsl' );
return $proc->transformToXML($dom);



the error: Fatal error: Class 'xsltprocessor' not found in /home/site.com/index.php on line 14

eak
06-08-2009, 11:52 PM
install it...
apt-get install php5-xsl

angst
06-09-2009, 12:01 AM
ah, i was looking all over for that, thanks!