当节点“name”等于“This is A”时,我试图根据下面的 XML 获取“state”的值:
<xml>
<event>
<name>This is A</name>
<state>OK</state>
</event>
<event>
<name>This is B</name>
<state>KO</state>
</event>
</xml>
做类似的事情是//event[name="This is A"]/state.text()
行不通的......我怎么能这样做?