选择下拉列表时如何调用XSL的模板函数
how can i call a template function of xsl when drop down is selected
当用户在下拉列表中选择一个选项时,我正在尝试在 XSl 代码中调用模板函数
<xsl:element name="select">
<xsl:attribute name="id">
<xsl:value-of select="$l" />
</xsl:attribute>
<xsl:attribute name="onchange">
<xsl:value-of select="TEMPLATE SHOULD BE CALLED HERE"/>
</xsl:attribute>
<option value="1">Select</option>
<option value="2">Daily</option>
<option value="3">Weekly</option>
<option value="4">Monthly</option>
<option value="5">RunOnStartup</option>
谁能告诉我调用模板的语法。
在浏览器中实现的 XSLT 1.0 中,XSLT 样式表生成 HTML,并且所有事件处理都必须在作为 HTML 的一部分生成的 Javascript 代码中完成。如果要从该 Javascript 回调到 XSLT,则必须使用转换 API 来启动新的转换。
如果您使用在 Saxon-CE 中实现的 XSLT 2.0,则此情况会发生变化。Saxon-CE 样式表可以包含响应用户事件的代码。您不需要为选择元素生成"onchange"属性。你只需要编写一个这样的模板规则:
<xsl:template match="select" mode="ixsl:onchange">
... code goes here ...
</xsl:template>
当 HTML 中的"选择"元素上发生"onchange"事件时,模板将自动执行。
有关撒克逊-CE的更多信息(和示例),请点击此处:
http://www.saxonica.com/ce/download.xml
xsl:template 元素的语法可以在这里找到: http://www.w3schools.com/xsl/el_template.asp
<xsl:template
name="name"
match="pattern"
mode="mode"
priority="number">
<!-- Content:(<xsl:param>*,template) -->
</xsl:template>
name: name Optional. Specifies a name for the template.
Note: If this attribute is omitted there must be a match attribute
match pattern Optional. The match pattern for the template.
Note: If this attribute is omitted there must be a name attribute
mode: mode Optional. Specifies a mode for this template
priority number Optional. A number which indicates the numeric priority of the template
相关文章:
- 创建一个类似链接的按钮,并通过Javascript函数打开一个新的弹出窗口
- 将函数的上下文应用于javascript变量
- 如何在JavaScript中将字符串转换为函数引用
- 用嵌套函数和默认函数定义函数
- 使用 jQuery 的 .on 函数如何获取事件的原始元素
- 无法导出函数expressjs/requestjs中的变量
- 函数参数中的数据与指定变量之间的任何性能差异
- 将文件路径从XSL传递到JavaScript函数
- 如何将Javascript数学函数与XSL一起使用
- 在xsl中调用具有某些参数的javascript函数
- 无法从 XSL 运行 JavaScript 函数
- 选择下拉列表时如何调用XSL的模板函数
- 如何将 xsl 变量作为参数传递给脚本标记中的 javascript 函数
- 如何在XSL-T中读取URL,然后将其传递给jQuery函数
- 传递值<xsl:value-of>转换为java脚本函数
- 将javascript和jquery与XSL转换或函数参数混合在一起的问题
- 如何在xsl文档中使用javascript函数
- 如何将XSL变量传递给Javascript函数
- 如何将xsl变量值传递给javascript函数
- javascript函数中的xsl:call-template