Jump to content

Php5 Xslt To Xsl Transition


Recommended Posts

With the transition to PHP5, XSLT support has been discontinued in favor of XSL. While they achieve the same result, many people using XSLT specific functions in their code are experiencing breakdowns. In researching this issue, I have found an excellent work around that is quite literally a drop-in fix:

 

http://alexandre.alapetite.net/doc-alex/xs...5/index.en.html

 

You simply need to upload a copy of xslt-php4-to-php5.php and add a single line to your XSLT code page:

 

>if (version_compare(PHP_VERSION,'5','>=')&&extension_loaded('xsl')) require_once('xslt-php4-to-php5.php');

 

If anyone has any trouble with the transition or setting this up, please open a ticket with the help desk.

Link to post
Share on other sites
  • 3 weeks later...

Hi Jesse,

 

Thanks for the information, I was using xslt functions, and had problems after the migration to php 5.

 

I tried using the code you suggest, but it still doesn't work.

 

I have a

 

Fatal error: Class 'XSLTProcessor' not found

 

 

Is it because the lib/plugin/extension is not correctly installed?

 

What should I do, or who should I ask to install it?

 

 

Thanks

 

 

Benjamin

 

 

ps: for information, I'm on the vortex server

Edited by bbeirnaert
Link to post
Share on other sites
  • 1 year later...

Hello:

 

I was wondering if there was any update on this or if anyone can provide any assistance. I've been trying to transform an XML file using XSL, but am not having any luck. I've tried about every possible method of transforming the XML, but always get an error - it's almost as if whatever methods are needed to transform XML are not turned on on the server (can anyone at TCH shed light on this?). Currently, I'm trying to use:

 

$xsl = new DomDocument;

$xsl->load('distanceorder.xsl');

 

$xp = new XsltProcessor();

$xp->importStylesheet($xsl);

 

$xml_doc = new DomDocument;

$xml_doc->loadXML($data);

$newdata=$xp->transformToXML($xml_doc);

 

And I get, in return:

 

Fatal Error: Class 'XsltProcessor' not found

 

Any suggestions or ideas? Any thoughts on which PHP functions to use to process the XML?

 

Thanks!

Andrew

Link to post
Share on other sites

Welcome to the forum, Andrew. :thumbup1:

 

If you´ve tried what James suggests in the first post in this thread and still no luck, I would open a ticket and ask the techs if they can look into this. Link to the helpdesk is on top of page and in my signature.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...