调用xsl中自定义的函数怎么不起作用?
Andy 2002-06-25 04:36:24 我在xsl中编写了下面的函数:
<msxsl:script language="VBScript" implements-prefix="user">
<![CDATA[
Function GenSelectBox()
strHtml = "<select name='a'>"
For i = 1 to 100
strHtml = strHtml & "<option value="&i&">"&i&"</option>"
Next
strHtml = strHtml &"</select>"
GenSelectBox = strHtml
End Function
]]>
</msxsl:script>
其目的是要生成一个select box,该select box包括了100个option,我用了下面的语句来调用该函数:
<xsl:value-of select="user:GenSelectBox()"/>
可是在浏览器中看不到所期望的select box,只能看到函数生成的那个字符串,这是为什么?
类似于这样的需求(有限次的循环生成一些html元素)能否直接在xslt中实现?
各位大虾有什么好办法,请指教!!