I have some xml that I want to process using xslt. A good amount of the data comes through in key value pairs (see below). I am struggling with how to extract the value base on the key into a variable. I would like to be able to do something like this:
<xsl:variable name="foo" select="/root/entry[key = 'foo']/value"/>
but that doesn't seem to work. Here is sample xml.
<?xml version="1.0" encoding="ISO-8859-1"?>
<root>
<entry>
<key>
foo
</key>
<value>
bar
</value>
</entry>
</root>
What would the correct xpath be for this?