I use tasker to edit setting from google maps. I have a xml file with following content.
<?xml version='1.0' encoding='utf-8' standalone='yes' ?>
<map>
...
<set name="nontransit_route_options$105347668285068041666">
<string>AVOID_TOLLS</string>
<string>AVOID_HIGHWAYS</string>
<string>AVOID_FERRIES</string>
</set>
...
</map>
Each togglebutton add by activating a line with
<string>AVOID_*</string>.
And remove the line by deactivating.
So now I want to add or remove a line with tasker. For example %avoid_highway is true so add line in set-tag.
Step 1 First I need to read the set-tag like (perl regex):
/<set.*name="nontransit_route_options.*(<\/set>|\/>)/gsu
I ignore the number cause I don't know what it means.
Step 2 I build my own set-tag and add the tag lines. Then replace the set-tag and save it.
One problem more: If all togglebuttons are deactivated the tag is self closed:
<set name="nontransit_route_options$105347668285068041666" />