xslt递归基础知识理解
请原谅我的初学者问题 现在我已经多次看到类似的xsl模板,但我不知道它实际上做了什么。有人能解释一下吗?谢谢xslt递归基础知识理解,xslt,recursion,Xslt,Recursion,请原谅我的初学者问题 现在我已经多次看到类似的xsl模板,但我不知道它实际上做了什么。有人能解释一下吗?谢谢 <xsl:template match="node()|@*"> <xsl:copy> <xsl:apply-templates select="node()|@*"/> </xsl:copy> </xsl:template> 该模板是身份转换模板,它匹配任何节点(文档节点和命名空间节点除外),并对节点进行浅
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>
该模板是身份转换模板,它匹配任何节点(文档节点和命名空间节点除外),并对节点进行浅层复制,然后处理其属性和子节点(只要存在) 模板通常是要更改、删除和/或添加某些节点的转换的起点,您可以使用例如
<xsl:template match="foo">
<bar>
<xsl:apply-templates select="@* | node()"/>
</bar>
</xsl:template>
<xsl:template match="baz"/>
<xsl:template match="foobar">
<xsl:copy>
<xsl:apply-templates select="@* | node()"/>
<whatever>...</whatever>
</xsl:copy>
</xsl:template>
要删除baz
元素,请使用例如
<xsl:template match="foo">
<bar>
<xsl:apply-templates select="@* | node()"/>
</bar>
</xsl:template>
<xsl:template match="baz"/>
<xsl:template match="foobar">
<xsl:copy>
<xsl:apply-templates select="@* | node()"/>
<whatever>...</whatever>
</xsl:copy>
</xsl:template>
...
在
foobar
元素中添加which
元素。再次感谢您回答我的所有问题!