Update an XML file with xmlstarlet


xmlstarlet is a great tool for working with XML files.

To change a value:

xmlstarlet edit --inplace --update "xpath" -v "NEW_VALUE" file.xml

To delete elements:

xmlstarlet edit --inplace --delete "xpath" file.xml

Source

Tags:  xml

Share: