PHP: XSLTProcessor->hasExsltSupport() - Manual

downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

XSLTProcessor->importStylesheet() XSLTProcessor->getParameter()

Last updated: Sat, 27 Jan 2007

view this page in

# XSLTProcessor->hasExsltSupport()

(no version information, might be only in CVS)

XSLTProcessor->hasExsltSupport() -- Determine if PHP has EXSLT support

## Описание

class XSLTProcessor {
bool hasExsltSupport ( void )
}

This method determine if PHP was built with the EXSLT library.

## Возвращаемые значения

Возвращает `TRUE` в случае успешного завершения или `FALSE` в случае возникновения ошибки.

## Примеры

Пример 1. Testing EXSLT support

`<?php
$proc = new XSLTProcessor;
if (!$proc->hasExsltSupport()) {
die('EXSLT support not available');
}
// do EXSLT stuff here ..
?>`

add a note User Contributed Notes
XSLTProcessor->hasExsltSupport()
bgarrett at jrcorps dot com
30-Mar-2005 11:29
`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.
Links:
EXSLT's page for the exsl:node-set() function
http://exslt.org/exsl/functions/node-set/index.html
Example on libxsl's mailing list:
http://mail.gnome.org/archives/xslt/2001-October/msg00063.html
--
Blaine Flynn Garrett
Chief Web Applications Developer
http://jrcorps.com JR Computer Associates INC`
add a note
XSLTProcessor->importStylesheet() XSLTProcessor->getParameter()

Last updated: Sat, 27 Jan 2007
show source | credits | stats | sitemap | contact | advertising | mirror sites
Copyright © 2001-2007 The PHP Group
All rights reserved.
This mirror generously provided by: Yahoo! Inc.
Last updated: Sat Mar 10 10:36:09 2007 PST