私のxml構造は次のようなものです
<items>
<item>
<brand>
<id> 3 </id>
</brand>
<product>
<productType>Type 1</productType>
</product>
</item>
<item>
<brand>
<id> 4 </id>
</brand>
<product>
<productType>Type 2</productType>
</product>
</item>
</items>
ユーザーがブランド ID を提供した場合、製品タイプの値を取得する必要があります。たとえば、ユーザーがブランド ID 3 を入力した場合、製品タイプタイプ 1を返す必要があります。
Xpath式でやってみた
/items/item/brand[id = 3]/product/productType
しかし、うまくいきません。正しい xpath 式は何でしょう。