Search

Without importing extensions fromexslt what functions are available to use out of the box? I would need to use lowercase, replace, and substrings before and after only these last seem to work. Or do I need to declare namespaces for using the most simple functions? Is there a way to test it like here?

I am starting to get the impression that out of the box symphonies engine is 'crippled' for serious transformations. I know that 2.0 engine offerigns are being considered, but I could use some insight into workign with what we got sofar, or how to use exslt and others.

Symphony is in php, which uses libXSLT. I'm pretty sure libXSLT has all the standard xslt1 functions, but I could be wrong. I don't think there is an xslt1 lowercase() function.

To use any exslt functions, you'll have to add the function-set's namespace, as well as the 'extension-element-prefixes' attribute (btw, if you're using more than one set, you can add them all in the value, just use spaces). See the exslt.org pages for examples, it's pretty simple to do.

If you check exslt.org, each function has an 'implementations' section at the bottom of the page. If it is implemented in libXSLT, then I think you're good. The only 'crippling' that Symphony does that I know of is that php functions within xsl are not declared. Also, an xsl:message output will kick back Symphony's xsl processing error response. But these are very small details, I wouldn't even call them problems.

The game-changer with exslt imho is node-set, which lets you do multi-pass processing. Evaluate is another nice one, since it allows you to do things like use xsl variables in your source xml doc, and evaulate them on the fly.

LibXSLT supports XSLT 1.0 functions. Unfortunately there is not yet a PHP implementation of XSLT 2.0 fit for use (not a fault of Symphony) but there have been positive strides in getting this working, and no doubt news will follow in the future. XSLT 2.0 is very powerful indeed.

Unfortunately the EXSLT library is not supported in its entirety in LibXSLT. The best way to check, as ashooner suggests, is to check the "Implementations" list under each function and see whether LibXSLT is included there. The big one that is missing is regular expressions; something that I'd give a limb to have implemented.

XSLT 1.0 Pocket Reference has a good chapter on EXSLT and a checkbox after each function displaying whether it's supported with LibXSLT or not. Perhaps a chapter in the Symphony documentation regarding EXSLT would be appropriate.

However I've yet to find a problem that hasn't been solved with the current XSLT 1.0/EXSLT offering.

As for using EXSLT, you'll need to include the namespace at the top of your stylesheet and then you can call the function using the namespace prefix. So for example if I included the common namespace I can then use the node-set functions like:

<xsl:value-of select="exsl:node-set($nodes)"/>

Ashooner, I hadn't spotted dyn:evaluate before. That is bloody killer!

Thanks guys, this is very helpfull. Especially the multi pass processing; I done that by using modes, which worked on testxslt libxslt, but not on symphony. I'll try it with node-set now.

The use of functX is the same as exsl? Are there any others like this one can use for functions?

did anyone get the contain function to work? I havent seems its not suported (by my host)

contains is an XSLT 1.0 function so should be supported. Are you getting an error?

<xsl:if test="not(contains('team','i'))">
   There is no I in Team!
</xsl:if>

I did a while ago, implementing it again now, needed to be sure, thanks

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details