note 75054 deleted from function.xslt-process by nlopess
| From: | nlopess@php.net | Date: | Sat, 12 May 2007 11:30:11 +0000 |
| Subject: | note 75054 deleted from function.xslt-process by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-126448@lists.php.net to get a copy of this message | ||
Note Submitter: robert grig
----
i used <?php
// $xml and $xsl contain the XML and XSL data
$xml = 'tablets.xml';
$xsl = 'tablets.xsl';
$resultdoc = 'result.html';
$arguments = array(
'/_xml' => $xml,
'/_xsl' => $xsl
);
// Allocate a new XSLT processor
$xh = xslt_create();
$filebase = 'file://' . getcwd () . '/';
xslt_set_base($xh,$filebase);
// Process the document
//$result = xslt_process($xh, 'arg:/_xml', 'arg:/_xsl', NULL, $arguments);
$result = xslt_process($xh, 'arg:/_xml', 'arg:/_xsl', NULL, $arguments);
echo(xslt_process($xh, 'arg:/_xml', 'arg:/_xsl', NULL, $arguments));
if ($result) {
echo "SUCCESS, sample.xml was transformed by sample.xsl into the \$result";
echo " variable, the \$result variable has the following contents\n<br />\n";
echo "<pre>\n";
echo $result;
echo "</pre>\n";
} else {
echo "Sorry, sample.xml could not be transformed by sample.xsl into";
echo " the \$result variable the reason is that " . xslt_error($xh);
echo " and the error code is " . xslt_errno($xh);
}
xslt_free($xh);
?><a href="test/<?=$resultdoc?>">The result document</a><?
?>
and i get this error : Warning: Sablotron error on line 1: XML parser error 2: syntax error in
D:\robert\XMLtest\test.php on line 21
Does anybody can help me?