>_ IzzyLab

Topic breakdown

An XPath predicate is not only about string comparison but also numeric conditions on the contents of child elements: by comparing a nested tag's value against a threshold, you can filter nodes right inside the expression, without any external processing. The task teaches you to think of the query as a whole: narrow the set of book nodes with a condition on price, then take the right child element from the selected node. The value is still printed by xmlstarlet sel -t -v.

What's checked

  1. book costing more than 40 found

What it looks like