this (my) script i's ok:
<?php
$processor=xslt _create();
$result=xslt_pr ocess($processo r,'xsl/curriculum.xml' ,'xsl/curriculum.xsl' );
if (!$result) {
echo xslt_error($pro cessor);
}
else {echo $result;}
xslt_free($proc essor);
?>
...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="{$p ath}/xml/curriculum.xsl" ;
$result=xslt_pr ocess($processo r,$tree,$transf orm);
if (!$result) {
echo xslt_error($pro cessor);
}
else {echo $result;}
xslt_free($proc essor);
?>
....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\curric ulum-sablotron.php
on line 17 (--> $result=xslt_pr ocess($processo r,$tree,$transf orm); )
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
<?php
$processor=xslt _create();
$result=xslt_pr ocess($processo r,'xsl/curriculum.xml' ,'xsl/curriculum.xsl' );
if (!$result) {
echo xslt_error($pro cessor);
}
else {echo $result;}
xslt_free($proc essor);
?>
...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="{$p ath}/xml/curriculum.xsl" ;
$result=xslt_pr ocess($processo r,$tree,$transf orm);
if (!$result) {
echo xslt_error($pro cessor);
}
else {echo $result;}
xslt_free($proc essor);
?>
....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\curric ulum-sablotron.php
on line 17 (--> $result=xslt_pr ocess($processo r,$tree,$transf orm); )
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
Comment