以文本方式查看主题

-  中文XML论坛 - 专业的XML技术讨论区  (http://bbs.xml.org.cn/index.asp)
--  『 XSL/XSLT/XSL-FO/CSS 』  (http://bbs.xml.org.cn/list.asp?boardid=8)
----  <x:transform > 出现的的怪现象  (http://bbs.xml.org.cn/dispbbs.asp?boardid=8&rootid=&id=12826)


--  作者:dart
--  发布时间:12/16/2004 5:31:00 PM

--  <x:transform > 出现的的怪现象
我在 resin 2.1.4 下面运行,做了两个 XSL和两个XML:
explorer.xsl     一个XSL,用于显示一个树形菜单
select.xsl        另一个XSL,用于显示树形菜单,并在每一项后面加上复选框

tree.xml        树形菜单的 XML 文件。用 explorer.xsl 来转换
treeSelect.xml   树形菜单XML文件,用 select.xsl 来转换。

在 IE 下运行,一切正常,两个 XML 文件都能正常显示。

在 jsp 文件中,好像不能直接用 <jsp:include page="tree.xml" />将 xml 包含进来。无奈,只好

在 a.jsp 中,加入
    <c:import charEncoding="GBK" url="treeSelect.xml" var="xml"/>
    <c:import charEncoding="GBK" url="select.xsl" var="xsl"/>
    <x:transform xml="${xml}" xslt="${xsl}"/>

在 b.jsp 中,加入
    <c:import charEncoding="GBK" url="tree.xml" var="xml"/>
    <c:import charEncoding="GBK" url="explorer.xsl" var="xsl"/>
    <x:transform xml="${xml}" xslt="${xsl}"/>

运行,能够正常显示。但是,怪事出来了:

如果我先运行 b.jsp,显示一个树形菜单,Ok;然后运行 a.jsp 时,显示的还是树形菜单,而不是带选择框的树形菜单;

如果我先运行 a.jsp,显示一个带选择框的树形菜单,Ok;然后运行 b.jsp 时,显示的还是带选择框的树形菜单,而不是树形菜单;

显示那一个,取决于第一次运行时调用的那一个 xml 文件,以后,永远不变。

查 resin 的 WEB-INF/work 下面,果然只生成了一个 _jstl_23a.java,按道理,两个 stl 应该生成两个工作文件才对。

这是为什么?因该如何解决?恳请高手帮助!



W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
218.750ms