I have config.xml with following line inside.
<widget id="dev.apk" version="2.5-dev" android-versionCode="20500-dev">
I'd like to change value of attributes 'version', 'id', and 'android-versionCode' in my Bash script.
In the script I have access to ID, VERSION an VERSION_CODE variables, like this:
ID ="release.apk"
VERSION="2.5"
VERSION_CODE="20500"
I'd like to use xmlstarlet or sed. What would be the best way?
Update
My .xml file looks like this:
<?xml version="1.0" encoding="utf-8"?>
<widget xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0" id="app" version="2.5" android-versionCode="20500">
<name>App title</name>
<description>Dummy dummy text.</description>
</widget>