Php5 - xsl extension not working

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 ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 05-05-2008
Chuck Anderson
 
Posts: n/a
Default Php5 - xsl extension not working

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.
***********************************

Reply With Quote
  #2 (permalink)  
Old 05-05-2008
Rik Wasmus
 
Posts: n/a
Default Re: Php5 - xsl extension not working

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
Reply With Quote
  #3 (permalink)  
Old 05-05-2008
Janwillem Borleffs
 
Posts: n/a
Default Re: Php5 - xsl extension not working

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
Reply With Quote
  #4 (permalink)  
Old 05-06-2008
Chuck Anderson
 
Posts: n/a
Default Re: Php5 - xsl extension not working

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.
***********************************

Reply With Quote
  #5 (permalink)  
Old 05-06-2008
Chuck Anderson
 
Posts: n/a
Default Re: Php5 - xsl extension not working

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.
***********************************

Reply With Quote
  #6 (permalink)  
Old 05-06-2008
Rik Wasmus
 
Posts: n/a
Default Re: Php5 - xsl extension not working

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
Reply With Quote
  #7 (permalink)  
Old 05-07-2008
Chuck Anderson
 
Posts: n/a
Default Re: Php5 - xsl extension not working

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.
***********************************

Reply With Quote
  #8 (permalink)  
Old 05-07-2008
Jerry Stuckle
 
Posts: n/a
Default Re: Php5 - xsl extension not working

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
==================

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 05:05 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0