这是xml:
<猫> <行> <col attr="w">111</col> <col attr="p">222</col> <col attr="g">333</col> <col attr="r">444</col> <col attr="n1">555</col> <col attr="n2">666</col> <col attr="s">777</col> </row> <行> <col attr="w">aaa</col> <col attr="p">bbb</col> <col attr="g">nnn</col> <col attr="r">嗯</col> <col attr="n1">xxx</col> <col attr="n2">ccc</col> <col attr="s">vvv</col> </row> </猫>
我要找的东西:找到
//cat/row/col[@attr='n2']
仅,如果在同一个父节点中
//cat/row/col[@attr='w']==111