如何在 xsl 文件中包含脚本标签? [英] how to include script tag in an xsl file?

查看:26
本文介绍了如何在 xsl 文件中包含脚本标签?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在一个使用 java 和 xsl 的旧站点上工作.如何在 xsl 文件中包含脚本文件?文件顶部:

I'm working on an old site that uses java and xsl. How can I inculde a script file in an xsl file? Top of the file:

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:include href="shipmentPackageInfo.xsl"/>

<script src="/fs/scripts/shipment/shipment.js"></script>

破坏应用

-- 更新 --

还有一个名为 pageHeader.xsl 的文件,其中包含所有的脚本标签

There is another file called pageHeader.xsl which has all the script tags inside of

<xsl:output method="html"/>
  <xsl:template match="PageHeaderData">

推荐答案

看看我对 XSLT 不允许我使用自闭合 img 和 br 标签

自关闭脚本标记 (<script src="code.js"/>) 会导致 JavaScript 文件无法加载,因此在您的 XSLT 中,您可能需要一些文本在脚本标签内防止它自关闭并使其工作.

Self closing script tags (<script src="code.js"/>) can cause the JavaScript files not to load, so inside of your XSLT, you may need to have some text inside the script tag to keep it from self closing and get it to work.

<script src="code.js>//</script>

这篇关于如何在 xsl 文件中包含脚本标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆