I\'m trying to read an xml file and read STRING \"50\" between the build tags from a XML file. I tried it but I\'m not getting any output.
The XML file..
...I'm sure you're aware that parsing XML with batch might not be the easiest/smartest thing to do. Tools like xmlstarlet and xidel are better suited for this:
xidel -q file.xml -e //build
...to save the buildnumber in a variable X and output it:
@echo off
for /f "delims=" %%a in ('xidel -q --output-format cmd file.xml -e "x:=//build"') do %%a
echo Build version = %x%
...even nicer would be if BeniBela (xidel coder) could program something like the following to directly set the environment variables and not generate a set command as ouput. That would be very powerful (and short). Beni? You're up for this? :-)
xidel -q -cmd file.xml -e x:=//build