summaryrefslogtreecommitdiff
path: root/examples/tree1
diff options
context:
space:
mode:
Diffstat (limited to 'examples/tree1')
-rw-r--r--examples/tree14
1 files changed, 4 insertions, 0 deletions
diff --git a/examples/tree1 b/examples/tree1
new file mode 100644
index 0000000..e027168
--- /dev/null
+++ b/examples/tree1
@@ -0,0 +1,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
+