Javascript 将XSL参数传递给JS
我尝试在XSL文件中向javascript传递一个参数。。。我该怎么做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: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包在里面了吗。。。谢谢你的努力!