note 17916 added to function.xslt-process

From: Date: Wed, 02 Jan 2002 21:20:07 +0000
Subject: note 17916 added to function.xslt-process
Groups: php.notes 
Request: Send a blank email to php-notes+get-24312@lists.php.net to get a copy of this message
I had quite a bit of a struggle working out how to pass variables / params to the xsl stylesheet using the last optional argument of the xslt_process function. For some odd reason it seems that xslt_process doesn't accept a NULL in place of the optional args argument. I found that the following solution worked out fine. ----- $xml_data = load_file('some.xml'); $xh = xslt_create(); $args = array ( '/_xml' => $xml_data ); $params = array ( 'somevariable' => 'somecontent' ); $result = xslt_process($xh, 'arg:/_xml', 'index.xsl', NULL, $args, $params); ----- HTH for anyone with similar problems. -- http://www.php.net/manual/en/function.xslt-process.php http://master.php.net/manage/user-notes.php?action=edit+17916 http://master.php.net/manage/user-notes.php?action=delete+17916 http://master.php.net/manage/user-notes.php?action=reject+17916

« previous php.notes (#24312) next »