Selection attribute value with xpath by filtering on a subitem-value
how can I select a node-attribute with xpath by filtering on a subnode-attribute?
I have a xml structure like this:
<base>
<item name="foo">
<subitem value="blubb" />
</item>
</base>
N开发者_StackOverflow中文版ow I want the name-attribute-value ("foo") from the item-tag(s) where the value-attribute of the subitem(s) is "blubb".
Thx 4 help
Use:
string(/*/item[subitem/@value='blubb']/@name)
精彩评论