I have the following problem:
my XML (simplified):
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<properties>
<property name="username">USERNAME</property>
<property name="anything">blabla</property>
</properties>
</configuration>
I need to replace the Username value with augeas. It works fine with:
augtool> set /files/test.xml/configuration/properties/property[1]/#text NEWUSER
But the problem is: The username entry is NOT always on position one. Is there a way in augeas to look for the position with "match" or some kind of regex?
augtool> match /files/test.xml/configuration/properties/*/#attribute/name username
works fine an results in
/files/test.xml/configuration/properties/property[1]/#attribute/name
But i don't know how to use this information when setting a value.