I have a pom.xml, that I want to change the properties values for tags that starting in a certain pattern.
I usually use xmlstarlet to manipulate XML bu
I don't have xmlstartet but I can help with sed
sed -ibak 's/\(<company\.mgrid\.[^>]*>\)0.8-SNAPSHOT/\10.9-SNAPSHOT/' pom.xml
will do the job and backup your original file in pom.xml.bak if needed. I you dont want this backup file, remove bak after the i flag.
What you are interested in is the Xpath function starts-with. It is a standard function since Xpath 1.0. This allows you to do :
$ xmlstarlet ed -N N="http://maven.apache.org/POM/4.0.0" \
-u "//N:*[starts-with(name(),'company.mgrid')]" \
-v "0.9-SNAPSHOT" pom.xml