Ciao ragazzi, ho un grosso problema per far cambiare due template in xsl in base ad un determinato evento (ovvvero alla pressione di un tasto con il mouse).
Il mio file xsl
codice:
<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" encoding="iso-8859-1" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
<xsl:param name="a">init()</xsl:param>
<xsl:template match="LESSONS">
<xsl:if test="$a=0">
<p class="TITLE2" align="center"><xsl:value-of select="TITLE2" /></p>
<div class="PARA" align="justify">
<xsl:apply-templates select="PARA" />
</div>
</xsl:if>
<xsl:if test="$a=1" >
<p class="TITLE2"><xsl:value-of select="TITLE2" /></p>
</xsl:template>
<div class="PARA">
<xsl:apply-templates select="PARA" />
</div>
</xsl:if>
<input type="button" value="Format" onclick="javascript:format({$a})"/>
</xsl:stylesheet>
e javascript
codice:
function format(value)
{
alert(value);
if(value==0)
return 1;
else
return 0;
}
function init()
{
return 0;
}
Il problema è che la riga <xsl
aram name="a">init()</xsl
aram> nel file xsl non funziona. Però se tolgo e metto un valore manuamente 1 o 0 allora magicamente funziona. Qualche d'uno può darmi una soluzione per cortesia??