Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
<a> <b> <html:p><html:a>link1</html:a><html:a>link2</html:a></html:p></b></a>
如何获得链接的数量?
如果你想要所有 html:a 节点,无论它们在哪里(不仅仅是你的例子中的那些)
<xsl:template match="/"> <xsl:value-of select="count(//html:a)"/> </xsl:template>
您可以使用对象节点计算链接。尝试这个 -<xsl:value-of select="count(/root/*)"/>
<xsl:value-of select="count(/root/*)"/>