有人可以解释一下为什么以下给我的错误:
Keyword xsl:template may not contain xsl:next-match
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl = "http://www.w3.org/1999/XSL/Transform" version = "3.0">
<xsl:template match="*">
<xsl:value-of select="name(.)"/><br/>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="rc2">
<h1>this is first match</h1>
<xsl:next-match/>
</xsl:template>
</xsl:stylesheet>
虽然这个版本没有错误,但当然它只匹配一个
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl = "http://www.w3.org/1999/XSL/Transform" version = "3.0">
<xsl:template match="*">
<xsl:value-of select="name(.)"/><br/>
<xsl:apply-templates/>
<xsl:next-match/>
</xsl:template>
<xsl:template match="rc2">
<h1>this is first match</h1>
</xsl:template>
</xsl:stylesheet>
我的测试 xml 文件是:
<?xml version="1.0"?>
<rc2/>
(问题修订编辑)我正在使用 Msxml2.XSLTemplate.6.0、Msxml2.FreeThreadedDOMDocument.6.0 和 Msxml2.DOMDocument.6.0