relpipe-data/examples.xml
author František Kučera <franta-hg@frantovo.cz>
Sat, 06 Jun 2020 13:22:57 +0200
branchv_0
changeset 300 b9bd0f06b4a1
parent 244 d4f401b5f90c
permissions -rw-r--r--
MySQL seems to works well even with libmyodbc5a.so not only libmyodbc5w.so ODBC driver

<stránka
	xmlns="https://trac.frantovo.cz/xml-web-generator/wiki/xmlns/strana"
	xmlns:m="https://trac.frantovo.cz/xml-web-generator/wiki/xmlns/makro">
	
	<nadpis>Examples</nadpis>
	<perex>Usage examples of Relational pipes tools</perex>
	<pořadí>40</pořadí>

	<text xmlns="http://www.w3.org/1999/xhtml">
		
		
		<p>
			All examples were tested in <a href="https://www.gnu.org/software/bash/">GNU Bash</a>.
			But they should also work in other shells.
		</p>
		
		<m:skript jazyk="bash" výstup="xhtml"><![CDATA[
			echo "<ul>";
			DIR=$(dirname "$XWG_STRANKA_SOUBOR");
			DIR="$DIR/../vstup"
			cd "$DIR";
			# TODO: use XQuery? (but Grep and Bash are everywhere)
			for f in examples-*.xml; do
				grep -oP '(?<=<m:pořadí-příkladu>).*(?=</m:pořadí-příkladu>)' $f | tr \\n ' '
				echo "<li><m:a href=\"${f//\.xml/}\">$(grep -oP '(?<=<nadpis>).*(?=</nadpis>)' $f)</m:a> – $(grep -oP '(?<=<perex>).+(?=</perex>)' $f)</li>";
			done | sort | sed -E 's/^[0-9]+ //'
			echo "</ul>";
		]]></m:skript>
		
	</text>

</stránka>