在xsl中调用具有某些参数的javascript函数

在xsl中调用具有某些参数的javascript函数,javascript,xml,xslt,Javascript,Xml,Xslt,我是xsl新手,我想调用一个函数podInfo,参数是我在xsl中捕获的xml文档的一些属性值。但是函数调用不正确,请大家建议我是对的。下面是片段 <xsl:variable name="xx" select="@name"/> <td> <a href="#" onclick="podInfo(<xsl:value-of select="$xx"/>)"> <xsl:value-of select="@name"/>

我是xsl新手,我想调用一个函数podInfo,参数是我在xsl中捕获的xml文档的一些属性值。但是函数调用不正确,请大家建议我是对的。下面是片段

<xsl:variable name="xx" select="@name"/>
<td>
   <a href="#" onclick="podInfo(<xsl:value-of select="$xx"/>)">
       <xsl:value-of select="@name"/>
   </a>
</td>
您需要使用元素,这将允许您轻松地编写onclick,即通过使用与此元素相关的元素,如etc

可能是这样的:

<a href="#">
  <!-- xsl:attribute means that instead of putting it's result
       into output document, they will be placed as an attributes
       value of parent element (<a> in this case) -->
  <xsl:attribute name="onclick">
     podInfo(<xsl:value-of select="$xx"/>)
  </xsl:attribute>
  <xsl:value-of select="@name"/>
</a>
有关其他示例,请参见。

另一种方法可能是