note 68924 added to function.xslt-process

From: Date: Wed, 16 Aug 2006 11:30:41 +0000
Subject: note 68924 added to function.xslt-process
Groups: php.notes 
Request: Send a blank email to php-notes+get-115965@lists.php.net to get a copy of this message
To let xslt_process() work correctly, you have to set xslt_set_base() Here is my example code (Tested on: Windows 2000/XAMPP 1.4.15/PHP 4.4.0/Sablotron 1.0.2): <?php $xh = xslt_create(); $filebase = 'file://' . getcwd () . '/test/'; xslt_set_base($xh,$filebase); $xml = 'document.xml'; $xsl = 'document.xsl'; $resultdoc = 'result.html'; $parameters = array('mynode' => '<foo>bar</foo>','sample' => 'A sample value'); $result = xslt_process($xh,$xml,$xsl,$resultdoc,NULL,$parameters); if (!$result) { die(sprintf("Cannot process XSLT document [%d]: %s",xslt_errno($xh), xslt_error($xh))); } echo "Result: ".$result."<br />"; xslt_free($xh); ?><a href="test/<?=$resultdoc?>">The result document</a><? ?> ---- Server IP: 217.160.72.57 Probable Submitter: 194.94.251.45 (proxied: 192.168.20.80) ---- X-Spam-Status: No, hits=3.3 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER, HTML_MESSAGE autolearn=no version=2.64 ---- Manual Page -- http://www.php.net/manual/en/function.xslt-process.php Edit -- https://master.php.net/note/edit/68924 Del: integrated -- https://master.php.net/note/delete/68924/integrated Del: useless -- https://master.php.net/note/delete/68924/useless Del: bad code -- https://master.php.net/note/delete/68924/bad+code Del: spam -- https://master.php.net/note/delete/68924/spam Del: non-english -- https://master.php.net/note/delete/68924/non-english Del: in docs -- https://master.php.net/note/delete/68924/in+docs Del: other reasons-- https://master.php.net/note/delete/68924 Reject -- https://master.php.net/note/reject/68924 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#115965) next »