Consider the following XML
:
<Items>
<Item>
<Code>Test</Code>
<Value>Test</Value>
</Item>
<Item>
<Code>MyCode</Code>
<Value>MyValue</Value>
</Item>
<Item>
<Code>AnotherItem</Code>
<Value>Another value</Value>
</Item>
</Items>
I would like to select the Value
node of the Item
that has the Code
node in with the value MyCode
. How would I go about using XPath
?
I've tried using Items/Item[Code=MyCode]/Value
but it doesn't seem to work.