Menu

[83373b]: / examples / tree1  Maximize  Restore  History

Download this file

5 lines (3 with data), 204 Bytes

#!/bin/sh
# Print subtree of elements having given element as a descendant (advanced XPath)
./xmlstarlet ed -d '//node()[not(descendant-or-self::isbn or parent::isbn)] | //*[parent::isbn]' xml/books.xml

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.