I have the following XML file :
<Configuration .... status="INFO" >
<properties>
<property name="logfile">/var/log/app.log</property>
<property name="log-level">INFO</property>
</properties>
</Configuration>
I'm trying to replace the INFO in the log-level property to DEBUG.
[root]# xmlstarlet edit --update "/Configuration/properties/property[@name='log-level']/@value" --value DEBUG test.xml
<?xml version="1.0"?>
<Configuration status="INFO">
<properties>
<property name="logfile">/var/log/app.log</property2>
<property name="log-level">INFO</property>
</properties>
</Configuration>
The output in stdout is exactly the same as the orig file, nothing is changed.
I tried to search for the XPath to make sure that I used the right one and it worked :
[root]# xmlstarlet sel -t -v "count(Configuration/properties/property[@name='log-level'])" test.xml
1
I tried also to change the @name instead of the @value and it worked.
What am I missing ? Why the output(in stdout) isn't changed ?