Delicious Bookmark this on Delicious Share on Facebook SlashdotSlashdot It! Digg! Digg

PHP : Function Reference : XSL functions : XSLTProcessor::hasExsltSupport


Determine if PHP has EXSLT support ()

Example 2651. Testing EXSLT support


= new XSLTProcessor;
if (!
$proc->hasExsltSupport()) {
'EXSLT support not available');

// do EXSLT stuff here ..


Related Examples ( Source code ) » xsl xsltprocessor has exslt support

Code Examples / Notes » xsl xsltprocessor has exslt support


I was scratching my head for hours on this one...
I had written a niftly little xsl-based form library a while back that worked great in PHP 4's less strict sablotron processor. The library was making use of some Result-Tree Fragments that, when I switched to PHP 5, resulted in some crazy output.
I was doing a bit more reading on Result-Tree Fragments in XSL and decided I needed to use something to turn the fragment into a node-set.
So, I was trying to use exslt's node-set() function as part of the exsl/common namespace. The phpinfo() and xsl-xsltprocessor::has-exslt-support() said I had EXSLT support.
However, when I used the examples on the exslt site I was getting the error:
"Warning: xmlXPathCompOpEval: function node-set not found in ./libraries/functions/xml_functions.php on line 24
Warning: Unregistered function in ./libraries/functions/xml_functions.php on line 24"
I google the errors, but only found some msxsl related mailing list articles. There was nothing relating to PHP or libxslt specifically.
I then searched on the libxslt site and found an example of someone using the "exslt" namespace vs the "exsl" namespace  as used on the EXSLT's documentation.
Sure enough, I changed the namespace, and it worked slick.
The moral of the story is that PHP's support for EXSLT's common lib has the "exslt" namespace and that this bug doesn't seem to get any notice from Google. This is why I am being verbose in hopes google will pick this comment up as to help other getting this error.
EXSLT's page for the exsl:node-set() function
Example on libxsl's mailing list:
Blaine Flynn Garrett
Chief Web Applications Developer JR Computer Associates INC

Change Language

Follow Navioo On Twitter
eXTReMe Tracker