Here is my setup:

这是我的设置:

<?xml version="1.0"?>
<xsl:transform  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:include href="top.xsl"/>  
<xsl:template match="">
Content here - divs and such
</xsl:template>            
</xsl:transform>

Then this is the stylesheet that I am trying to include.

然后这是我想要包含的样式表。

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html"/>
<xsl:template match="/">
Standard html file now, html, head,title,script,body etc. 

Closes like this:

这样关闭:

<xsl:apply-templates />
        </body>
    </html>
</xsl:template>

</xsl:stylesheet>

Why won't the include work?

为什么包含不起作用?

Edit: Here is the full code: https://gist.github.com/anonymous/3432742335a8fd3c600f

编辑:这是完整的代码:https://gist.github.com/anonymous/3432742335a8fd3c600f

1 个解决方案

#1


0

When you do <xsl:apply-templates /> in your nav.xsl this will look for child nodes of the document node. As XML needs a single root element to be well-formed, you can replace your currently empty template match with this to match this root element

在nav.xsl中执行 时,将查找文档节点的子节点。由于XML需要单个根元素格式良好,因此可以使用此替换当前为空的模板匹配以匹配此根元素

<xsl:template match="/*" >

更多相关文章

  1. 在c#中获取html元素的实际边距
  2. 两个堆叠的元素与他们旁边的元素成比例增长
  3. html css伪元素标签(二)灵活
  4. 如何使用Watir访问自定义属性的元素?
  5. HTML5按钮元素新属性formaction,formenctype等简介
  6. easyui-tree根据叶子节点获取父节点值(N层)
  7. 禁用div中的所有表单元素
  8. 怎么动态设置html的canvas元素的尺寸?
  9. JQuery基于元素的高度添加类

随机推荐

  1. Android4.4系统源代码百度网盘下载
  2. 读书笔记(一)---GoogleAndroid开发入门指南
  3. android中去掉标题栏和状态栏
  4. 【Android學習專題】搭建Android NDK环境
  5. Android 5.1源代码与Nexus设备工厂镜像下
  6. RatingBar
  7. android timed gpio (linux 3.0.0) 受时
  8. Android -- Sqlite事务
  9. Android ListView 去除边缘阴影、选中色
  10. 转:Android 发送短信的方法