I am trying to call an external javaScript function in XSLT file,the function will be called when i click on the image element.
The XSLT file is as bellow:
<xsl:template match="link|para//link">
<xsl:element name="a">
<xsl:attribute name="href">
<!--OpenPopupDetailsTexte('<xsl:value-of select="@href"/>', 1);-->
<!--alert();-->
</xsl:attribute>
<xsl:attribute name="title">
<xsl:choose>
<xsl:when test="text() = 'n'">Note circulaire</xsl:when>
<xsl:when test="text() = 'm'">Modification</xsl:when>
<xsl:when test="text() = 'd'">Décret d application</xsl:when>
<xsl:when test="text() = 'ma'">Abrogation</xsl:when>
<xsl:when test="text() = 't'">Renvoi au texte</xsl:when>
<xsl:when test="text() = 'a'">Arrêté ministériel</xsl:when>
<xsl:when test="text() = 'mc'">Texte complétant cette disposition</xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:element name="img">
<xsl:attribute name="src">/assets/projets/images/<xsl:value-of select=". "/>.gif</xsl:attribute>
<xsl:attribute name="border">0</xsl:attribute>
</xsl:element>
</xsl:element>
</xsl:template>
the name of my external function is OpenPopupDetailsTexte.
the results in HTML is :
<a href="unsafe: javascript:OpenPopupDetailsTexte('cgitva_T19_N1', 1) " title="Note circulaire"><img src="/assets/projets/images/n.gif" border="0"></a>