0
有,我无法理解,并会感激求助的问题:一个XSL选择=“子::节点”问题
我有一个XML文件,它看起来像这样
<xml>
<parent>
<child_node>1</child_node>
<child_node>2</child_node>
<child_node>3</child_node>
</parent>
<parent>
<child_node>4</child_node>
</parent>
</xml>
而一个XSL模板:
<xsl:template name="template">
<xsl:param name="top_node"/>
<xsl:for-each select="$top_node/child::child_node">
<xsl:value-of select="."/>
</xsl:for-each>
</xsl:template>
被称为与<xsl:with-param name="top_node" select="xml/parent">
我预计这将返回只有子节点是单个父节点的子节点,如图所示here,但它会返回所有子节点。我在这里错过了什么?