This is a discussion on Php5 - xsl extension not working within the PHP Language forums, part of the PHP Programming Forums category; I can tell I'm not alone in my confusion, as I've been using Google to find a solution ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
I can tell I'm not alone in my confusion, as I've been using Google to
find a solution to this problem and all I can find is the same question, but no solution. I am running Php 5.25 (Windows binary from php.net) as an Apache 2.0.55 module on Windows XP. I have enabled the xsl extension - php_xsl.dll - in php.ini and indeed, when I look at phpinfo I see all the needed libraries (i.e., DOM/XML, libXML, XSL, libxslt) are enabled. Yet, if I try to call xslt_create(), I get: "Fatal error: Call to undefined function xslt_create() in ....." Any idea what I need to do to get this working? Detail from phpinfo: ------------------------- dom DOM/XML enabled DOM/XML API Version 20031129 libxml Version 2.6.26 HTML Support enabled XPath Support enabled XPointer Support enabled Schema Support enabled RelaxNG Support enabled libxml libXML support active libXML Version 2.6.26 libXML streams enabled xml XML Support active XML Namespace Support active libxml2 Version 2.6.26 xsl XSL enabled libxslt Version 1.1.17 libxslt compiled against libxml Version 2.6.26 EXSLT enabled libexslt Version 0.8.13 ------------------------- -- ***************************** Chuck Anderson • Boulder, CO http://www.CycleTourist.com Nothing he's got he really needs Twenty first century schizoid man. *********************************** |
|
|||
|
On Mon, 05 May 2008 05:11:51 +0200, Chuck Anderson
<websiteaddress@seemy.sig> wrote: > I can tell I'm not alone in my confusion, as I've been using Google to > find a solution to this problem and all I can find is the same question, > but no solution. > > I am running Php 5.25 (Windows binary from php.net) as an Apache 2.0.55 > module on Windows XP. > > I have enabled the xsl extension - php_xsl.dll - in php.ini and indeed, > when I look at phpinfo I see all the needed libraries (i.e., DOM/XML, > libXML, XSL, libxslt) are enabled. > > Yet, if I try to call xslt_create(), I get: > "Fatal error: Call to undefined function xslt_create() in ....." > > Any idea what I need to do to get this working? > > Detail from phpinfo: > ------------------------- > dom > libxml > xml > xsl > XSL enabled > libxslt Version 1.1.17 > libxslt compiled against libxml Version 2.6.26 > EXSLT enabled > libexslt Version 0.8.13 And XSLT? http://nl2.php.net/manual/en/xslt.installation.php Check out sablot.dll, expat.dll, and iconv.dll. P.S: for PHP >= 5 I'd recommend XSL instead of XSLT. -- Rik Wasmus |
|
|||
|
Chuck Anderson schreef:
> I can tell I'm not alone in my confusion, as I've been using Google to > find a solution to this problem and all I can find is the same question, > but no solution. > > I am running Php 5.25 (Windows binary from php.net) as an Apache 2.0.55 > module on Windows XP. > > I have enabled the xsl extension - php_xsl.dll - in php.ini and indeed, > when I look at phpinfo I see all the needed libraries (i.e., DOM/XML, > libXML, XSL, libxslt) are enabled. > > Yet, if I try to call xslt_create(), I get: > "Fatal error: Call to undefined function xslt_create() in ....." > > Any idea what I need to do to get this working? > By looking at the manual: http://www.php.net/xsl XSL in PHP5 has been implemented in the XSLTProcessor class... JW |
|
|||
|
Janwillem Borleffs wrote:
> Chuck Anderson schreef: > >> I can tell I'm not alone in my confusion, as I've been using Google to >> find a solution to this problem and all I can find is the same question, >> but no solution. >> >> I am running Php 5.25 (Windows binary from php.net) as an Apache 2.0.55 >> module on Windows XP. >> >> I have enabled the xsl extension - php_xsl.dll - in php.ini and indeed, >> when I look at phpinfo I see all the needed libraries (i.e., DOM/XML, >> libXML, XSL, libxslt) are enabled. >> >> Yet, if I try to call xslt_create(), I get: >> "Fatal error: Call to undefined function xslt_create() in ....." >> >> Any idea what I need to do to get this working? >> >> > > By looking at the manual: http://www.php.net/xsl > > XSL in PHP5 has been implemented in the XSLTProcessor class > ... > > > JW > Okay, .... thanks. I had tried a quick test of that previously and it failed, but I must have misspelled something, as the XSLTProcessor class does indeed work. Now all I need to do is get my web host to enable this, as it seems the best way to ensure an xml -> xsl transformation is to do it server side and NOT rely on the browser or JavaScript. I'm having fun experimenting with this stuff. -- ***************************** Chuck Anderson • Boulder, CO http://www.CycleTourist.com Nothing he's got he really needs Twenty first century schizoid man. *********************************** |
|
|||
|
Rik Wasmus wrote:
> On Mon, 05 May 2008 05:11:51 +0200, Chuck Anderson > <websiteaddress@seemy.sig> wrote: > > >> I can tell I'm not alone in my confusion, as I've been using Google to >> find a solution to this problem and all I can find is the same question, >> but no solution. >> >> I am running Php 5.25 (Windows binary from php.net) as an Apache 2.0.55 >> module on Windows XP. >> >> I have enabled the xsl extension - php_xsl.dll - in php.ini and indeed, >> when I look at phpinfo I see all the needed libraries (i.e., DOM/XML, >> libXML, XSL, libxslt) are enabled. >> >> Yet, if I try to call xslt_create(), I get: >> "Fatal error: Call to undefined function xslt_create() in ....." >> >> Any idea what I need to do to get this working? >> >> Detail from phpinfo: >> ------------------------- >> dom >> > > >> libxml >> > > >> xml >> > > >> xsl >> XSL enabled >> libxslt Version 1.1.17 >> libxslt compiled against libxml Version 2.6.26 >> EXSLT enabled >> libexslt Version 0.8.13 >> > > And XSLT? > > I seem to have it all enabled now I was trying to use the Php4 functions in Php5. > http://nl2.php.net/manual/en/xslt.installation.php > Check out sablot.dll, expat.dll, and iconv.dll. > Those are for the Php4 implementation, only (as far as I can tell). > P.S: for PHP >= 5 I'd recommend XSL instead of XSLT. > I'm not sure what you mean here, but I would like to understand, as I think I'm on to a new way of doing things (for me) by converting MySQL data to XML and using XSL transform to create the HTML output. How do I "use XSL instead of XSLT" ...? I thought they were basically the same thing . Can you be more precise .... or point me to something that explains what you mean. -- ***************************** Chuck Anderson • Boulder, CO http://www.CycleTourist.com Nothing he's got he really needs Twenty first century schizoid man. *********************************** |
|
|||
|
On Tue, 06 May 2008 08:00:02 +0200, Chuck Anderson
<websiteaddress@seemy.sig> wrote: > Rik Wasmus wrote: >> On Mon, 05 May 2008 05:11:51 +0200, Chuck Anderson >> <websiteaddress@seemy.sig> wrote: >> >> >>> I can tell I'm not alone in my confusion, as I've been using Google >>> to find a solution to this problem and all I can find is the same >>> question, but no solution. >>> >>> I am running Php 5.25 (Windows binary from php.net) as an Apache >>> 2.0.55 module on Windows XP. >>> >>> I have enabled the xsl extension - php_xsl.dll - in php.ini and >>> indeed, when I look at phpinfo I see all the needed libraries (i.e., >>> DOM/XML, libXML, XSL, libxslt) are enabled. >>> >>> Yet, if I try to call xslt_create(), I get: >>> "Fatal error: Call to undefined function xslt_create() in ....." >>> >>> Any idea what I need to do to get this working? >>> >>> Detail from phpinfo: >>> ------------------------- >>> dom >>> >> >> >>> libxml >>> >> >> >>> xml >>> >> >> >>> xsl >>> XSL enabled >>> libxslt Version 1.1.17 >>> libxslt compiled against libxml Version 2.6.26 >>> EXSLT enabled >>> libexslt Version 0.8.13 >>> >> >> And XSLT? >> >> > > I seem to have it all enabled now I was trying to use the Php4 functions > in Php5. > >> http://nl2.php.net/manual/en/xslt.installation.php >> Check out sablot.dll, expat.dll, and iconv.dll. >> > > Those are for the Php4 implementation, only (as far as I can tell). > >> P.S: for PHP >= 5 I'd recommend XSL instead of XSLT. >> > > I'm not sure what you mean here, Instead of using these: http://nl2.php.net/manual/en/ref.xslt.php Use these: http://nl2.php.net/manual/en/class.xsltprocessor.php > but I would like to understand, as I think I'm on to a new way of doing > things (for me) by converting MySQL data to XML and using XSL transform > to create the HTML output. Be very sure you _need_ that. IMHO, XML is usefull for storage (which you could not need because you allready have a database for storage, but perhaps some caching be usefull), or communication/data sharing between scripts, which you also don't mention. In most projects, I'd say the conversion database -> XML -> HTML would be an unnecessary step, and database -> HTML is just a lot less overhead. -- Rik Wasmus |
|
|||
|
Rik Wasmus wrote:
> On Tue, 06 May 2008 08:00:02 +0200, Chuck Anderson > <websiteaddress@seemy.sig> wrote: > > >> Rik Wasmus wrote: >> >>> On Mon, 05 May 2008 05:11:51 +0200, Chuck Anderson >>> <websiteaddress@seemy.sig> wrote: >>> >>> >>> >>>> I can tell I'm not alone in my confusion, as I've been using Google >>>> to find a solution to this problem and all I can find is the same >>>> question, but no solution. >>>> >>>> I am running Php 5.25 (Windows binary from php.net) as an Apache >>>> 2.0.55 module on Windows XP. >>>> >>>> I have enabled the xsl extension - php_xsl.dll - in php.ini and >>>> indeed, when I look at phpinfo I see all the needed libraries (i.e., >>>> DOM/XML, libXML, XSL, libxslt) are enabled. >>>> >>>> Yet, if I try to call xslt_create(), I get: >>>> "Fatal error: Call to undefined function xslt_create() in ....." >>>> >>>> Any idea what I need to do to get this working? >>>> >>>> Detail from phpinfo: >>>> ------------------------- >>>> dom >>>> >>>> >>> >>>> libxml >>>> >>>> >>> >>>> xml >>>> >>>> >>> >>>> xsl >>>> XSL enabled >>>> libxslt Version 1.1.17 >>>> libxslt compiled against libxml Version 2.6.26 >>>> EXSLT enabled >>>> libexslt Version 0.8.13 >>>> >>>> >>> And XSLT? >>> >>> >>> >> I seem to have it all enabled now I was trying to use the Php4 functions >> in Php5. >> >> >>> http://nl2.php.net/manual/en/xslt.installation.php >>> Check out sablot.dll, expat.dll, and iconv.dll. >>> >>> >> Those are for the Php4 implementation, only (as far as I can tell). >> >> >>> P.S: for PHP >= 5 I'd recommend XSL instead of XSLT. >>> >>> >> I'm not sure what you mean here, >> > > Instead of using these: http://nl2.php.net/manual/en/ref.xslt.php > Use these: http://nl2.php.net/manual/en/class.xsltprocessor.php > > >> but I would like to understand, as I think I'm on to a new way of doing >> things (for me) by converting MySQL data to XML and using XSL transform >> to create the HTML output. >> > > Be very sure you _need_ that. IMHO, XML is usefull for storage (which you > could not need because you allready have a database for storage, but > perhaps some caching be usefull), or communication/data sharing between > scripts, which you also don't mention. > > In most projects, I'd say the conversion database -> XML -> HTML would be > an unnecessary step, and database -> HTML is just a lot less overhead. > What you say does make sense to me. I have only just now delved into xml - xsl so I could include it in my resume. And indeed, it seems a pretty simple tool to use. Where I think it's taking me now, as I explore my possibilities with it, is to show me how to modularize my Php - > html scripts better (like the xsl templates). The next thing I think I'll try with xml/xsl is a simple customized CMS (for instance, one that lets a site owner change a Links page). I think something like that may be easier than using MySQL. Either way, I want the experience so I can include it on my resume. I'm still pondering how to merge Php and xml/xsl. My guess is that I could use Php to create xsl files on the fly .... or to include them on the fly. But the more I think about that, the more I think, like you say, that simply modularizing my Php content templates (to be like like xsl template files) and getting my content from MySQL will be the most flexible and efficient. I appreciate the help and advice. -- ***************************** Chuck Anderson • Boulder, CO http://www.CycleTourist.com Nothing he's got he really needs Twenty first century schizoid man. *********************************** |
|
|||
|
Chuck Anderson wrote:
> Rik Wasmus wrote: >> On Tue, 06 May 2008 08:00:02 +0200, Chuck Anderson >> <websiteaddress@seemy.sig> wrote: >> >> >>> Rik Wasmus wrote: >>> >>>> On Mon, 05 May 2008 05:11:51 +0200, Chuck Anderson >>>> <websiteaddress@seemy.sig> wrote: >>>> >>>> >>>> >>>>> I can tell I'm not alone in my confusion, as I've been using >>>>> Google to find a solution to this problem and all I can find is >>>>> the same question, but no solution. >>>>> >>>>> I am running Php 5.25 (Windows binary from php.net) as an Apache >>>>> 2.0.55 module on Windows XP. >>>>> >>>>> I have enabled the xsl extension - php_xsl.dll - in php.ini and >>>>> indeed, when I look at phpinfo I see all the needed libraries >>>>> (i.e., DOM/XML, libXML, XSL, libxslt) are enabled. >>>>> >>>>> Yet, if I try to call xslt_create(), I get: >>>>> "Fatal error: Call to undefined function xslt_create() in ....." >>>>> >>>>> Any idea what I need to do to get this working? >>>>> >>>>> Detail from phpinfo: >>>>> ------------------------- >>>>> dom >>>>> >>>>> >>>> >>>>> libxml >>>>> >>>>> >>>> >>>>> xml >>>>> >>>>> >>>> >>>>> xsl >>>>> XSL enabled >>>>> libxslt Version 1.1.17 >>>>> libxslt compiled against libxml Version 2.6.26 >>>>> EXSLT enabled >>>>> libexslt Version 0.8.13 >>>>> >>>>> >>>> And XSLT? >>>> >>>> >>>> >>> I seem to have it all enabled now I was trying to use the Php4 >>> functions in Php5. >>> >>> >>>> http://nl2.php.net/manual/en/xslt.installation.php >>>> Check out sablot.dll, expat.dll, and iconv.dll. >>>> >>>> >>> Those are for the Php4 implementation, only (as far as I can tell). >>> >>> >>>> P.S: for PHP >= 5 I'd recommend XSL instead of XSLT. >>>> >>>> >>> I'm not sure what you mean here, >>> >> >> Instead of using these: http://nl2.php.net/manual/en/ref.xslt.php >> Use these: http://nl2.php.net/manual/en/class.xsltprocessor.php >> >> >>> but I would like to understand, as I think I'm on to a new way of >>> doing things (for me) by converting MySQL data to XML and using XSL >>> transform to create the HTML output. >>> >> >> Be very sure you _need_ that. IMHO, XML is usefull for storage (which >> you could not need because you allready have a database for storage, >> but perhaps some caching be usefull), or communication/data sharing >> between scripts, which you also don't mention. >> >> In most projects, I'd say the conversion database -> XML -> HTML would >> be an unnecessary step, and database -> HTML is just a lot less >> overhead. >> > > What you say does make sense to me. I have only just now delved into xml > - xsl so I could include it in my resume. And indeed, it seems a pretty > simple tool to use. Where I think it's taking me now, as I explore my > possibilities with it, is to show me how to modularize my Php - > html > scripts better (like the xsl templates). > > The next thing I think I'll try with xml/xsl is a simple customized CMS > (for instance, one that lets a site owner change a Links page). I think > something like that may be easier than using MySQL. Either way, I want > the experience so I can include it on my resume. > > I'm still pondering how to merge Php and xml/xsl. My guess is that I > could use Php to create xsl files on the fly .... or to include them on > the fly. But the more I think about that, the more I think, like you > say, that simply modularizing my Php content templates (to be like like > xsl template files) and getting my content from MySQL will be the most > flexible and efficient. > > I appreciate the help and advice. > Rik is correct. XML is not intended to be an intermediate step between the database and HTML. Rather, it is intended as a means for machine-to-machine transfer of data, i.e. one webserver picking up XML data from another and displaying it in a specific format. Using XML as an intermediate step between your database and HTML is an unnecessary step which adds much more overhead to the server. -- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstucklex@attglobal.net ================== |