Hi Greg,
> There is a really easy answer. PHP does not work inside XSL.
>
> Their are a couple of way you can get at your variables, pass them in as
> parameters, or make them part of your XML.
Funny this. There IS a really easy answer and it's not that it can't be
done.
This works fine. I put this in my xsl file...
<xsl:text disable-output-escaping="yes"><?
echo "<a href=\"/$wjLanguageCode/news/";
?></xsl:text>
<xsl:value-of select="headline"/>
<xsl:text disable-output-escaping="yes"><?
echo "\">";
?></xsl:text>
more...
<xsl:text disable-output-escaping="yes"><?
echo "</a>";
?></xsl:text>
... and when i get the result I pass it through an eval statement like
this...
eval("?>$result<?");
...and it works.
No claims that this is the best way to do it but it does exactly what i
need, ie, it puts a php variable into an xsl file. Hope this is helpful to
somebody else. If I've made a typo or other mistake in this message (ie, you
try and do this and it doesn't work) just email me, I'll be glad to help.
Greg, as I explained in my question, I couldn't use the options you
suggested as I need the class that creates the xml to be generic and still
have the ability to use custom variables when needed in the xsl file.
This solution works and it let's me do what I need. Glad I didn't give up
when you said it wasn't possible :)
Thanks anyway,
John