Select attribute value using xpath by filtering on subitem-value element

how can i select the node attribute from xpath by filtering the subnode attribute?

I have an xml structure like this:

<base>
  <item name="foo">
    <subitem value="blubb" />
  </item>
</base>

      

Now I want the attribute-value-name ("foo") from the tag-element (s) where the value attribute of the sub-element (s) is "blubb".

thanks 4 help

+2


a source to share


1 answer


Using



string(/*/item[subitem/@value='blubb']/@name)

+2


a source







All Articles