relpipe-data/examples/ssm-xmltable-1.makefile
branchv_0
changeset 271 a19312ab9db7
child 272 a756214f1ee8
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/relpipe-data/examples/ssm-xmltable-1.makefile	Sun Oct 06 11:24:40 2019 +0200
@@ -0,0 +1,20 @@
+build/statistics.rp: text/ssm.en.xml
+	mkdir -p build
+	cat text/ssm.en.xml \
+		| relpipe-in-xmltable \
+			--namespace "m" "tag:globalcode.info,2019:sane-software/manifesto" \
+			--relation "chapter" \
+				--records "//m:chapter" \
+				--attribute "name" string "m:name" \
+				--attribute "requirements" integer "count(descendant::m:item[m:type='requirement'])" \
+				--attribute "recommendations" integer "count(descendant::m:item[m:type='recommendation'])" \
+				--attribute "informations" integer "count(descendant::m:item[m:type='information'])" \
+				--attribute "items_total" integer "count(descendant::m:item)" \
+		> build/statistics.rp
+
+# Prints a table with number of items in particular chapters:
+statistics: build/statistics.rp
+	cat build/statistics.rp | relpipe-out-tabular
+	
+statistics-chart: build/statistics.rp
+	cat build/statistics.rp | relpipe-tr-cut ".*" "(name|.*s)" | relpipe-out-gui -title "Sane software manifesto – chart of rule types"