Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/12.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参数传递给JS_Javascript_Xml_Xslt - Fatal编程技术网

Javascript 将XSL参数传递给JS

Javascript 将XSL参数传递给JS,javascript,xml,xslt,Javascript,Xml,Xslt,我尝试在XSL文件中向javascript传递一个参数。。。我该怎么做 <xsl:variable name="currentPath"> <xsl:value-of select="concat($path, ./name)"/>/ </xsl:variable> <script> someFunction(someParameter); </script> 由于布局原因,我将在此处再次尝试: &

我尝试在XSL文件中向javascript传递一个参数。。。我该怎么做

    <xsl:variable name="currentPath">
        <xsl:value-of select="concat($path, ./name)"/>/
    </xsl:variable>

<script>
 someFunction(someParameter);
</script>
由于布局原因,我将在此处再次尝试:

<script>  document.getElementById('<xsl:value-of select="$currentPath"></xsl:value-of>').style.display = 'none'; 
</script> 
我使用了一个变量,它是模板中的一个参数

<xsl:template match="dir">  
<xsl:param name="path"/>
变量用作表的id:

<table border="0" id="$currentPath"> 
这个变量在其他地方使用,并且在那里工作。。。顺便说一下,我现在使用的是Firefox 3.5.xx

另一编辑: 我把


就在脚本标记和预期结果之前。。。变量不是问题所在…

在表元素中的引用周围使用大括号:

<table border="0" id="{$currentPath}">

在表格元素中的引用周围使用大括号:

<table border="0" id="{$currentPath}">

你从哪里经过?你首先需要的是SomeFunction,然后是SomeFunction,你把javascript包在里面了吗。。。谢谢你的努力!你从哪里经过?你首先需要的是SomeFunction,然后是SomeFunction,你把javascript包在里面了吗。。。谢谢你的努力!