I have an XML object created from the below:
<?xml version="1.0" encoding="UTF-8"?>
<pdfDoc>
<XMLOutput>
<webservice>
<residentLocationData>
<addressDataMap>
<entry>
<key>Zip</key>
<value>08094</value>
</entry>
<entry>
<key>CountyCode</key>
<value>015</value>
</entry>
<entry>
<key>StateName</key>
<value>New Jersey</value>
</entry>
</addressDataMap>
</residentLocationData>
</webservice>
</XMLOutput>
<pdfDoc>
And I'm trying to extract the string value of "New Jersey". To get the "value" element itself, I'm using:
//addressDataMap/entry/key[text() = 'StateName']/following-sibling::value
But I haven't seen anything online that says how to get the string value of that element's xmlText, using just XPath itself. I CAN get that string using code from the language I'm working with (Coldfusion):
<cfset theState = xmlSearch(L.xmlObj, "//addressDataMap/entry/key[text() = 'StateName']/following-sibling::value")[1].xmlText>
but I'm not clear on how to get only the string "New Jersey" using just XPath.