[thelist] XML+XSL+PHP+Windows tip

Nicole Parrot nicole at parrot.ca
Fri Jan 18 20:00:52 CST 2002


<tip author="nicole parrot">
If you decide to install PHP 4.1.0 or higher onto a Windows machine (it
seems the version of windows is irrelevent), and to activate the XSLT
extension for it, there's an undocumented feature that you should know
about.

The call to xslt_process will most likely fail,  unless you use the
"file://" prefix for the path to your xml and your xsl file.

Example:
$result = xslt_process($xh, 'c:/mywebs/file.xml',
'c:/mywebs:/xslfile.xsl','c:/mywebs/output.html');
will fail with this error message:

Warning: Sablotron error on line 1: unknown encoding '' in
C:\mywebs\test.php
where test.php is the file you're trying to run.

The solution is simple, once you know it

$result = xslt_process($xh, 'file://c:/mywebs/file.xml',
'file://c:/mywebs:/xslfile.xsl','file://c:/mywebs/output.html');
will work.

Details at http://bugs.php.net/bug.php?id=14965
</tip>

And yes, I lost 2 days on that problem.. grrr..  BTW this is independent of
which server you're running on Windows.

Nicole







More information about the thelist mailing list