【发布时间】:2016-11-16 13:48:39
【问题描述】:
我需要根据其中一个孩子是否满足所有条件来过滤节点。这是一个例子:
<root>
<grp pos="1">
<test pos="1" id="2"/>
<test pos="2" id="1"/>
<test pos="3" id="1"/>
<test pos="4" id="2"/>
<test pos="5" id="1"/>
</grp>
<grp pos="2">
<test pos="6" id="1"/>
<test pos="7" id="2"/>
<test pos="8" id="1"/>
<test pos="9" id="1"/>
<test pos="10" id="2"/>
</grp>
</root>
和xsl
<xsl:template match="/root">
<xsl:value-of select="grp[test/@pos='1' and test/@id='1']/@pos"/>
</xsl:template>
我需要test 来为这两种情况引用同一个节点。我想要的是没有任何grp 节点来传递条件,但第一个节点可以,因为它有一个通过第一个条件的子节点和另一个通过第二个条件的子节点。我希望谓词需要一个同时通过的孩子。
【问题讨论】: