note 55513 added to ref.xsl
| From: | olivier dot sow at alias dot france | Date: | Fri, 05 Aug 2005 13:27:38 +0000 |
| Subject: | note 55513 added to ref.xsl | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-93130@lists.php.net to get a copy of this message | ||
if you have 'XML parser error 4: not well-formed (invalid token)' error without but your
are sure to do no error at all, try this:
<?
function
XSL_transformation($XMLFile,$XSLFile,$ResultFile,$xsl_params){
$Str = '';
$xp = xslt_create() or trigger_error('Could not create XSLT process.', E_USER_ERROR);
xslt_set_encoding($xp, 'ISO-8859-1');
// read the files into memory
$xsl_string = join('', file($XSLFile));
$xml_string = join('', file($XMLFile));
// set the argument buffer
$arg_buffer = array('/xml' => $xml_string, '/xsl' => $xsl_string);
// process the two files to get the desired output
if (($Str = xslt_process($xp, 'arg:/xml', 'arg:/xsl', NULL, $arg_buffer,
$xsl_params))){
//Saves transformation result into '$ResultFile'
$fp = fopen($ResultFile,"w+");
fwrite($fp,$Str);
fclose($fp);
return true;
}
return false;
}
?>
found here: http://bugs.php.net/bug.php?id=16193
----
Manual Page -- http://www.php.net/manual/en/ref.xsl.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+55513
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+55513&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+55513&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+55513&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+55513&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+55513&report=yes&reason=non-english
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+55513&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+55513&report=yes
Search -- http://master.php.net/manage/user-notes.php