I am parsing a XML file like below:
Here's the xpath.bat -small script that will allow you to get a xml values by xpath expression without using external binaries:
call xpath.bat "connection.config" "//connection/@name"
call xpath.bat "connection.config" "//connection/@value"
to assign this to a variable:
for /f "tokens=* delims=" %%# in ('xpath.bat "connection.config" "//connection/@value"') do set "connection_value=%%#"
echo %connection_value%