passing content of file as argument
| From: | William S. | Date: | Thu, 20 Feb 2003 15:24:00 +0000 |
| Subject: | passing content of file as argument | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-136376@lists.php.net to get a copy of this message | ||
I would like to pass the content of "./doc_test2.xml"
as an argument. How would I alter the file below to
accomplish this? Do I need to change the stylesheet as
well?
begin *.php----------------
<?php
$xml = "./doc_test.xml";
$xsl = "./doc_test.xsl";
$mydata = "./doc_test2.xml";
$arguments = array();
$arguments['mydata'] = $mydata;
ob_start();
$_parser = xslt_create();
if( !$result = @xslt_process( $_parser, // resource xh
$xml, // string xsl
$xsl,
NULL,
$arguments,
array()
) ) {
printf( "Sablotron Error (%s): <br /><strong>%s</strong>",
xslt_errno($_parser), xslt_error($_parser) );
}
ob_end_clean();
xslt_free($_parser);
echo $result;
?>
end *.php----------------
--
Bill
Amsterdam, NL