>_ IzzyLab

Topic breakdown

XML is parsed not with regexes but with a tool that understands the tree structure — for example xmlstarlet sel, which fetches data via an XPath expression. In XPath a node's attribute is accessed through the @ prefix, and the right node is selected with a predicate in square brackets — a condition on its content or child elements. The task teaches you to assemble an XPath from two parts: first find the right book by a condition on its nested title, then step to its attribute.

What's checked

  1. genre attribute extracted

What it looks like