blob: e0271681f83acd2c497ca5ad5f6134305e503ffa (
plain)
1
2
3
4
|
#!/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
|