Hallo,
ik probeer d.m.v. een xslt processor mijn xml & xls om te zetten naar html output. In de applicatie waarin ik deze xml & xsl file heb gemaakt werkt dit. Dit wil ik ook graag doen d.m.v. php. Zodat ik diverse templates voor een website kan gebruiken.
Nu heb ik op PHP.net in de manual al een heel stuk over een XSLT processor gevonden. Maar ik krijg dit maar niet werkend in PHP5...
Dit is de code die ik gebruik om te testen:
En de error die ik krijg:
ik probeer d.m.v. een xslt processor mijn xml & xls om te zetten naar html output. In de applicatie waarin ik deze xml & xsl file heb gemaakt werkt dit. Dit wil ik ook graag doen d.m.v. php. Zodat ik diverse templates voor een website kan gebruiken.
Nu heb ik op PHP.net in de manual al een heel stuk over een XSLT processor gevonden. Maar ik krijg dit maar niet werkend in PHP5...
Dit is de code die ik gebruik om te testen:
PHP:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
| <?php // $xml and $xsl contain the XML and XSL data $xml = file_get_contents("personal.xml"); $xsl = file_get_contents("personal.xsl"); $arguments = array( '/_xml' => $xml, '/_xsl' => $xsl ); // Allocate a new XSLT processor $xh = xslt_create(); // Process the document $result = xslt_process($xh, 'arg:/_xml', 'arg:/_xsl', NULL, $arguments); if ($result) { print "SUCCESS, xml was transformed by xsl into the \$result"; print " variable, the \$result variable has the following contents\n<br>\n"; print "<pre>\n"; print $result; print "</pre>\n"; } else { print "Sorry, xml could not be transformed by xsl into"; print " the \$result variable the reason is that " . xslt_error($xh) . print " and the error code is " . xslt_errno($xh); } xslt_free($xh); ?> |
En de error die ik krijg:
code:
1
| Fatal error: Call to undefined function xslt_create() in C:\wamp\www\xslttest.php on line 12 |