Re: [xsl]Putting PHP Code in XSLT?

Subject: Re: [xsl]Putting PHP Code in XSLT?
From: Alice Ju-Hsuan Wei <ajwei@xxxxxxxxxxx>
Date: Fri, 21 Sep 2007 06:30:37 -0400

Just to test, here is what I have:

<xsl:processing-instruction name="php">echo "Hello!"; ?</xsl:processing-instruction>

The source code of the section above is there, but it is not working. When I take the ? off, the product becomes <?php echo "Hello!"; > which is not in HTML format.

The other thing is, why don't we need to do this with Javascript?


Quoting David Carlisle <davidc@xxxxxxxxx>:

   I have some PHP code somewhere that can provide this function, but I
don't know if I can put it in XSLT. If I can, does anyone have any idea
of where I put it?

XSLT just generates a file, it doesn't need to know what language the file contains, whether it is english or german or php is all the same.

There doesn't need to be any interaction between the PHP and XSLT
engines, if you generate code that looks like php, most likely by
<xsl:processing-instruction name="php">....
xslt will generate
<?php ....
and so if you pass that to a php engine on the server the code ... will
be executed.


The Numerical Algorithms Group Ltd is a company registered in England
and Wales with company number 1249803. The registered office is:
Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.

This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs.

Current Thread