Call to undefined function xslt_create()

software development

#1

I am trying to use PHP to do perform a simple XSLT transformation along the lines described here:


However, I am getting the error:

Can you help?

Thanks,

Gids


#2

Since youre in the same boat that I am - 40-something views and no replys yet, i’ll reply to yours.
From what I can tell, that’s a php4 extension. You are probably using php5.

try this right after “<?php”

$proc = new XSLTProcessor; if (!$proc->hasExsltSupport()) { die('EXSLT support not available'); }else{ die('Hooked Up!'); }
FROM the manual:
http://www.php.net/manual/en/intro.xslt.php
Note:
This extension has been moved to the » PECL repository and is no longer bundled with PHP as of PHP 5.0.0.

Note: If you need xslt support with PHP 5 you can use the XSL extension.

Here’s the xsl extension:
http://www.php.net/manual/en/class.xsltprocessor.php

theSquerg.


#3

Thanks, that did the trick. I used the documentation at:
http://www.tonymarston.net/php-mysql/xsl.html


#4

Great!

Here’s the sitepoint one converted for you too if it helps.

[code]$xslDoc = new DOMDocument();
$xslDoc->substituteEntities = true;
$xslDoc->load(“docbook.xsl”);

$xmlDoc = new DOMDocument();
$xmlDoc->load(“docbook.xml”);

$proc = new XSLTProcessor();
$proc->importStylesheet($xslDoc);
if(!$proc->transformToXML($xmlDoc)){
die('Houston…We have a problem '.libxml_get_errors());
}else{
echo $proc;
}[/code]


#5

I too am having this problem, but am not quite experienced enough to know what the next step is. I got “Hooked up” to post from the script you provided. Can you please provide a little more detailed information on how you solved this problem? Do I need to edit the php.ini file? Do I need relocate it? Edit a specific xls extension?

Thank you for your patience and help.