0
我想選擇所有b,其中c2attr > 5
在c2 = text2
。在XPath中,我寫道:XPath,如何選擇必須滿足子1的兩個屬性的父節點?
a/b[c2 = text2 and c2attr >5]
但是,它並沒有給我的條件,既滿足時c2=text2
,c2attr >5
。 它給了我每個c2元素,它有c2attr >5
。我應該怎樣寫才能正確選擇
b?
例如:
<a>
<b>
<c1>c1 text</c1>
<c2 c2attr="3">text1</c2>
<c2 c2attr="8">tex2</c2>
<c2 c2attr="50">text3</c2>
</b>
<b>
<c1>c1 text</b1>
<c2 c2attr="1">text4</c2>
<c2 c2attr="6">tex2</c2>
<c2 c2attr="10">text1</c2>
</b>
</a>
非常感謝您!