/ ** * Convert XML file to HTML content according to XSL files * @Param string $ xslfile - xsl file * @Param string $ xmlfile - XML file * Need to load related DLLs, such as: iconv, xslt, etc. * /
FUNCTION
Getxmlhtml
(
$ xslfile
=
False
,
$ xmlfile
=
False
) {
$ xslstring
=
Implode
(
'' '
,
File
(
$ xslfile
));
$ xmlstring
=
Implode
(
'' '
,
File
(
$ xmlfile
));
$ arguments
= array
'/ _xml'
=>
$ xmlstring
,
'/ _xsl'
=>
$ xslstring
);
$ xh
=
XSLT_CREATE
();
$ RESULT
=
XSLT_PROCESS
(
$ xh
,
'arg: / _ xml'
,
'arg: / _ xsl'
,
NULL
,
$ arguments
); If
$ RESULT
) {RETURN
$ RESULT
;
XSLT_Free
(
$ xh
} Else {return
"ERR"
;
XSLT_Free
(
$ xh
}}
// end function getXmlhtml ()