note 25621 added to function.xslt-process

From: Date: Mon, 30 Sep 2002 19:28:13 +0000
Subject: note 25621 added to function.xslt-process
Groups: php.notes 
Request: Send a blank email to php-notes+get-37435@lists.php.net to get a copy of this message
The output of the XSLT process doesn't have to be necessarily HTML. If you receive a lot of data in the XML and want to distribute it along all your page, you can convert all your page to XHTML or force the output to be PHP code and then eval()uated. For instance, your XSL document (part of it) could look like: <xsl:text disable-output-escaping="yes">$networth=</xsl:text><xsl:value-of select="networth" /><xsl:text disable-output-escaping="yes">;</xsl:text> and your PHP code could look like: $result = xslt_process($xh, 'arg:/_xml', 'arg:/_xsl', NULL, $arguments); if ($result) { eval(addslashes($result)); that way, you can use the variable $networth in wherever you want inside your PHP file, like: <? print $networth; ?> -- http://www.php.net/manual/en/function.xslt-process.php http://master.php.net/manage/user-notes.php?action=edit+25621 http://master.php.net/manage/user-notes.php?action=delete+25621 http://master.php.net/manage/user-notes.php?action=reject+25621

« previous php.notes (#37435) next »