For the following XML:
<properties>
<entry key="foo">bar</entry>
</properties>
I can update exiting entry with attribute "foo" with the following augeas command:
set /files/test.xml/properties/entry[#attribute/key='foo']/#text bar2
Is there augeas command(s) to create a new node (with key attribute) if there is no existing entry with the input attribute, and update existing if entry already exists with the input attribute? I tried the following:
set /files/test.xml/properties/entry[#attribute/key='hello']/#text world
But this only results in the following, without attribute:
<properties>
<entry key="foo">bar2</entry>
<entry>world</entry>
</properties>