我有以下代码
<xsl:result-document href="output1/output3/index.html" format="html">
<html>
<head>
<SCRIPT LANGUAGE="JavaScript">
function getParams()
{
var idx = document.URL.indexOf('?');
var params = new Array();
if (idx != -1) {
var pairs = document.URL.substring(idx+1, document.URL.length).split('&');
for (var i=0; i<pairs.length; i++) {
nameVal = pairs[i].split('=');
params[nameVal[0]] = nameVal[1];
}
}
return params;
}
params = getParams();
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript">
val = unescape(params["value"]);
document.write("value = " + val);
</SCRIPT>
</head>
<body>
<xsl:choose>
<xsl:when test="a:id=''">
<xsl:value-of select="a:name"/>
</xsl:when>
</xsl:choose>
</body>
</html>
</xsl:result-document>
我想访问 xsl:when' 中的 javascript 变量 'val'。我需要该值才能运行条件。任何想法 - 怎么做?