我有这个非常简单的代码,它应该生成我的HTML,但我得到的只是白页。
我尝试了几乎任何东西,它只是空白页。如果任何人都可以检查并告诉我我做错了什么,我会在天堂!
PHP代码:
$xp = new XsltProcessor();
// create a DOM document and load the XSL stylesheet
$xsl = new DomDocument;
$xsl->load('template-file.xls');
// import the XSL styelsheet into the XSLT process
$xp->importStylesheet($xsl);
// create a DOM document and load the XML datat
$xml_doc = new DomDocument;
$xml_doc->load('temporary-file.xml');
// transform the XML into HTML using the XSL file
if ($html = $xp->transformToXML($xml_doc)) {
return $html;
} else {
return "
FAILED
";}XML文件:
EFX
682ZB08042
199
2
02
1
ZUVICH, TYLER J
196722017
这是XLS模板文件:
xmlns:php="http://php.net/xsl"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
Boreau | |
Customer Number | |
Customer Reference Code |