In order to pass PHP variables into an XSL document you need to do the following:
Firstly I created the following function to use:
function GetXHTML($sXML, $sXSL, $aParameters)
{
$hXML = xslt_create();
$aArguments = array('/_xml' => $sXML, '/_xsl' => $sXSL);
$sXHTML = xslt_process($hXML, 'arg:/_xml', 'arg:/_xsl', NULL, $aArguments, $aParameters);
xslt_free($hXML);
return $sXHTML;
}
Then call it like thus, passing the XML and XSL as a string with the final parameter being an array which can contain as many values as you wish to pass in:
$sXHTML = GetXHTML($sXML, $sXSL, array("age"=>"26"));
Then in the XSL document you need the following:
<xsl:param name="age" />
Then where you want to display the value of age you do this:
<xsl:value-of select="$age" />
Thanks now.