>_ IzzyLab

Topic breakdown

xmlstarlet can not only read but also edit XML — that is handled by the ed (edit) subcommand, which applies actions to the tree: updating a node's value is done with the update operation, specifying an XPath and the new value. By default the result is printed to stdout, and to rewrite the file in place there is a separate in-place flag. The task teaches you to address a specific node with a predicate on an attribute and change its value structurally, without breaking the rest of the XML with a crude text replacement.

What's checked

  1. b1 price updated to 99
  2. nothing else broken

What it looks like