Re: Using PHP inside XSLT...
| From: | Jirka Kosek | Date: | Mon, 11 Sep 2000 11:25:13 +0000 |
| Subject: | Re: Using PHP inside XSLT... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-16153@lists.php.net to get a copy of this message | ||
Sam Piper wrote:
> Is it possible to use <?php ?> tags inside a standard XSLT template? I've tried
> doing this verbatim, but the parser ignores the tags. Is any additional configuration needed outside
> of the XSLT engine itself?
>
> The idea is that a variable will be supplied into a PHP tag by the XSLT engine, that PHP will
> be returned along with other HTML instructions to the web server, which then parses the PHP and
> sends the results to the browser.
You can add simple template to your XSLT, which will just copy PHP code
down to result from XSLT.
<xsl:template match="processing-instruction('php')">
<xsl:processing-instruction name="php">
<xsl:value-of select="."/>
</xsl:processing-instruction>
</xsl:template>
I've never tryed this, but it shoud work.
-----------------------------------------------------------------
Jirka Kosek
e-mail: jirka@kosek.cz
http://www.kosek.cz