XPath fetch dynamic http header values
Following is an XPath that can come in handy to read name value pair elements.
Basically this is done for reading tibco dynamic headers which comes as a repeated header containing name and value elements but the below xpath can be used for any XML document processing.
Below is the XML and XPath example
<DanamicHeaders> <Header> <Name>api_key1</Name> <Value>key1</Value> </Header><Header> <Name>api_key2</Name> <Value>key2</Value> </Header><DanamicHeaders>
/DynamicHeaders//Header[Name/text()='api_key1']/Value/text()
The above xpath evaluates to value “key1”