这个模板在XSLT中的工作原理?

时间:2018-05-30 08:56:49

标签: xslt

这个模板的工作原理,任何机构都能解释一下吗?

<xsl:template match="/*"> 
        <xsl:apply-templates />
 </xsl:template> 

1 个答案:

答案 0 :(得分:0)

在XPath中,有seven kinds of nodes:元素,属性,文本,命名空间,处理指令,注释和文档节点。

/是根节点。根节点是document node:它包含整个文档。

*匹配all children of that node。在大多数XML文档中,只有一个子元素:根元素。

示例XML:

<?xml version="1.0" encoding="UTF-8"?>
<start> - this is the root element
  <two - node on second level>
  <three - node on second level>
      <four - node on third level/>
  </three>
</start>

所以它会匹配元素节点start

相关问题