【发布时间】:2011-01-17 11:54:51
【问题描述】:
我正在处理的网页显示一个主页区域,其内容来自包含所需 HTML 的外部 xml 文件。
例如
<xhtml:content>
<div id="marketingContent">
<div id="topLeft">
<div id="intro"> .....
我们有一个 XSL 模板,它使用这个 xml 并将其显示在整个页面中。
目前这是静态内容,但需要根据您所在的页面动态显示该内容中的多个链接。
我们在另一个 xml 文件中有此信息,但想注入一个 xsl 模板以在外部 xml 文件中显示这些链接。
例如
<xhtml:content>
<div id="marketingContent">
<div id="topLeft">
<div id="intro">
<!-- Dynamic link area -->
<div id="links">
list of links based on the area of the site you are in
</div> ....
这可能吗,最好的方法是什么 - 对 xsl 来说相当新
提前致谢
【问题讨论】:
-
查看您的 XSLT 确实会有所帮助。
-
@user502014:这看起来像人口模式。见stackoverflow.com/questions/3529852/…
-
这根本不是 XSLT 问题。需要的是: 1. 一个完整的(但尽可能最小的)源 XML 文档。 2.想要的结果。 3. 一组规则/要求结果中的项目如何与 XML 文档中的项目相关联。没有这些,我们只能猜测您的问题到底是什么。请提供。