0

次のような XML ファイルがあるとします。

<abc:persons>
<abc:person id="1">
    ...
</abc:person>
<abc:person id="2">
    ...
</abc:person>
</abc:persons>

これを考えると、IDが1の人を選択したい場合、xpath式はどうなりますか.

ありがとう。

4

2 に答える 2

3

要素を検索し、述語を使用して属性値を区別してみてください。

//abc:person[@id = 1]
于 2013-10-30T22:09:04.347 に答える