Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/413.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/79.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用javascript变量在xsl中创建href_Javascript_Html_Xml_Xslt - Fatal编程技术网

如何使用javascript变量在xsl中创建href

如何使用javascript变量在xsl中创建href,javascript,html,xml,xslt,Javascript,Html,Xml,Xslt,我正在使用下面的代码创建href <xsl:template name="pageHeader"> <h1><xsl:value-of select="$TITLE"/></h1> <table width="100%"> <tr> <tr> <td align="right">Designed for use with <a <xsl:attrib

我正在使用下面的代码创建href

<xsl:template name="pageHeader">
    <h1><xsl:value-of select="$TITLE"/></h1>
    <table width="100%">
    <tr>
    <tr>
    <td align="right">Designed for use with <a <xsl:attribute name="href">javascript:returnHyperlink();</xsl:attribute> >JUnit</a> </td>
    </tr>
</table>
    <hr size="1"/>
</xsl:template>

设计用于



有人请纠正我代码中的错误

您的XSL代码甚至格式不好

使用以下代码创建属性:

<a><xsl:attribute name="href">javascript:returnHyperlink();</xsl:attribute>JUnit</a>

或者说:

<a href="javascript:returnHyperlink();">JUnit</a>

<a href="javascript:returnHyperlink();">JUnit</a>