this (my) script i's ok:
<?php
$processor=xslt_create();
$result=xslt_process($processor,'xsl/curriculum.xml','xsl/curriculum.xsl');
if (!$result) {
echo xslt_error($processor);
}
else {echo $result;}
xslt_free($processor);
?>
...where files are under c:\PHP directory!
but this don't work:
<?php
$processor=xslt_create();
$path=dirname(__FILE__);
$tree="{$path}/xml/curriculum.xml";
$transform="{$path}/xml/curriculum.xsl";
$result=xslt_process($processor,$tree,$transform);
if (!$result) {
echo xslt_error($processor);
}
else {echo $result;}
xslt_free($processor);
?>
....where files are under the directory where is the script
...and the output is:
Warning: Sablotron error on line 1: XML parser error 4: not well-formed
(invalid token) in D:\siti\prove\3_XML\php\curriculum-sablotron.php
on line 17 (--> $result=xslt_process($processor,$tree,$transform); )
XML parser error 4: not well-formed (invalid token)
where's the problem?
why Sablotron takes files only from the directory of PHP?
thank you!
Simone