relpipe-data/examples/ssm-xmltable-1.makefile
author František Kučera <franta-hg@frantovo.cz>
Tue, 11 May 2021 22:26:48 +0200
branchv_0
changeset 326 ab7f333f1225
parent 272 a756214f1ee8
permissions -rw-r--r--
relpipe-tr-cut has new syntax since v0.18: --relation, --attribute
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
271
a19312ab9db7 examples: Sane software manifesto statistics using XMLTable/XPath
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     1
build/statistics.rp: text/ssm.en.xml
a19312ab9db7 examples: Sane software manifesto statistics using XMLTable/XPath
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     2
	mkdir -p build
a19312ab9db7 examples: Sane software manifesto statistics using XMLTable/XPath
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     3
	cat text/ssm.en.xml \
a19312ab9db7 examples: Sane software manifesto statistics using XMLTable/XPath
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     4
		| relpipe-in-xmltable \
a19312ab9db7 examples: Sane software manifesto statistics using XMLTable/XPath
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     5
			--namespace "m" "tag:globalcode.info,2019:sane-software/manifesto" \
a19312ab9db7 examples: Sane software manifesto statistics using XMLTable/XPath
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     6
			--relation "chapter" \
a19312ab9db7 examples: Sane software manifesto statistics using XMLTable/XPath
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     7
				--records "//m:chapter" \
272
a756214f1ee8 examples: Sane software manifesto statistics using XMLTable/XPath (indentation, resume)
František Kučera <franta-hg@frantovo.cz>
parents: 271
diff changeset
     8
				--attribute "name"            string  "m:name" \
a756214f1ee8 examples: Sane software manifesto statistics using XMLTable/XPath (indentation, resume)
František Kučera <franta-hg@frantovo.cz>
parents: 271
diff changeset
     9
				--attribute "requirements"    integer "count(descendant::m:item[m:type='requirement'])" \
271
a19312ab9db7 examples: Sane software manifesto statistics using XMLTable/XPath
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    10
				--attribute "recommendations" integer "count(descendant::m:item[m:type='recommendation'])" \
272
a756214f1ee8 examples: Sane software manifesto statistics using XMLTable/XPath (indentation, resume)
František Kučera <franta-hg@frantovo.cz>
parents: 271
diff changeset
    11
				--attribute "informations"    integer "count(descendant::m:item[m:type='information'])" \
a756214f1ee8 examples: Sane software manifesto statistics using XMLTable/XPath (indentation, resume)
František Kučera <franta-hg@frantovo.cz>
parents: 271
diff changeset
    12
				--attribute "items_total"     integer "count(descendant::m:item)" \
271
a19312ab9db7 examples: Sane software manifesto statistics using XMLTable/XPath
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    13
		> build/statistics.rp
a19312ab9db7 examples: Sane software manifesto statistics using XMLTable/XPath
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    14
a19312ab9db7 examples: Sane software manifesto statistics using XMLTable/XPath
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    15
# Prints a table with number of items in particular chapters:
a19312ab9db7 examples: Sane software manifesto statistics using XMLTable/XPath
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    16
statistics: build/statistics.rp
a19312ab9db7 examples: Sane software manifesto statistics using XMLTable/XPath
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    17
	cat build/statistics.rp | relpipe-out-tabular
a19312ab9db7 examples: Sane software manifesto statistics using XMLTable/XPath
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    18
	
a19312ab9db7 examples: Sane software manifesto statistics using XMLTable/XPath
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    19
statistics-chart: build/statistics.rp
326
ab7f333f1225 relpipe-tr-cut has new syntax since v0.18: --relation, --attribute
František Kučera <franta-hg@frantovo.cz>
parents: 272
diff changeset
    20
	cat build/statistics.rp | relpipe-tr-cut --relation ".*" --attribute "(name|.*s)" | relpipe-out-gui -title "Sane software manifesto – chart of rule types"