Jump to content

Recommended Posts

I've been doing PHP for about 2 months now. The project I'm working on currently is taking an XML feed and translating it into HTML. I have done tons of research on this and found there are several ways to go about this depending on what it installed on my server. I wrote XSLT templates for years now and that is my proffered method of tackling this project. The server I am using is PHP5 The problem I am facing is this. I have a php file that contains the following:

<?
$parser = xslt_create();
  $html = xslt_process($parser, "test.xml", "gen_page.xsl");
  xslt_free($parser);

  echo $html;
?>

 

I am getting this error message "Fatal error: Call to undefined function xslt_create()" and was wondering if anyone has come across this error and what it means. I'm thinking the XSLT extensions are not configured in the server.

 

Thank You,

 

Corey Romero

Link to comment
https://forums.phpfreaks.com/topic/53041-wow-i-need-help/
Share on other sites

Have oa look at the Requirements and Installation notes here

 

http://www.php.net/manual/en/ref.xslt.php

 

 

~chigley

The two aren't mutually exclusive

<?php
    $xml = simpleXML_load_file('newsfeed.xml');
    $xsl = simpleXML_load_file('newsfeed.xsl');
    $proc = new XsltProcessor();
    $proc->importStylesheet($xsl);
    $newxml = $proc->transformToDoc($xml);
    print $newxml->saveXML();

    ?> 

Link to comment
https://forums.phpfreaks.com/topic/53041-wow-i-need-help/#findComment-262009
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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

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

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.