relpipe-data/examples/atom-xmltable.sh
branchv_0
changeset 263 8bf13358a50a
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/relpipe-data/examples/atom-xmltable.sh	Thu Jul 25 22:16:12 2019 +0200
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+get_atom() {
+	wget --quiet --output-document - https://blog.frantovo.cz/agregace/c/?p=10
+	# wget --quiet --output-document - https://blog.frantovo.cz/agregace/k/
+	# cat atom.xml
+}
+
+get_atom \
+	| relpipe-in-xmltable \
+		--namespace "a" "http://www.w3.org/2005/Atom" \
+		--relation "/a:feed/a:title" --name-is-xpath \
+			--records "//a:entry" \
+			--attribute "published" string "a:published" \
+			--attribute "title" string "a:title" \
+			--attribute "url" string "a:link/@href" \
+		--relation "metadata" \
+			--records "." \
+			--attribute "id" string "a:id" \
+			--attribute "subtitle" string "a:subtitle" \
+	| relpipe-out-tabular