author | František Kučera <franta-hg@frantovo.cz> |
Fri, 31 Jan 2020 23:34:53 +0100 | |
branch | v_0 |
changeset 26 | 0ea0534aee73 |
parent 25 | 8e2d9b67b51c |
child 29 | 509cac0cf411 |
permissions | -rwxr-xr-x |
25
8e2d9b67b51c
xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
1 |
#!/bin/bash |
8e2d9b67b51c
xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
2 |
|
8e2d9b67b51c
xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
3 |
# Relational pipes |
8e2d9b67b51c
xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
4 |
# Copyright © 2020 František Kučera (Frantovo.cz, GlobalCode.info) |
8e2d9b67b51c
xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
5 |
# |
8e2d9b67b51c
xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
6 |
# This program is free software: you can redistribute it and/or modify |
8e2d9b67b51c
xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
7 |
# it under the terms of the GNU General Public License as published by |
8e2d9b67b51c
xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
8 |
# the Free Software Foundation, version 3 of the License. |
8e2d9b67b51c
xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
9 |
# |
8e2d9b67b51c
xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
10 |
# This program is distributed in the hope that it will be useful, |
8e2d9b67b51c
xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
11 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
8e2d9b67b51c
xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
12 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
8e2d9b67b51c
xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
13 |
# GNU General Public License for more details. |
8e2d9b67b51c
xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
14 |
# |
8e2d9b67b51c
xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
15 |
# You should have received a copy of the GNU General Public License |
8e2d9b67b51c
xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
16 |
# along with this program. If not, see <http://www.gnu.org/licenses/>. |
8e2d9b67b51c
xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
17 |
|
8e2d9b67b51c
xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
18 |
DIR="$(dirname $0)" |
8e2d9b67b51c
xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
19 |
BASE="$(basename $0)" |
8e2d9b67b51c
xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
20 |
XSL="$DIR/$BASE.xsl" |
8e2d9b67b51c
xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
21 |
|
8e2d9b67b51c
xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
22 |
if [[ -f "$XSL" ]]; then |
8e2d9b67b51c
xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
23 |
relpipe-out-xml | xsltproc "$XSL" - |
8e2d9b67b51c
xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
24 |
else |
8e2d9b67b51c
xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
25 |
echo "unable to find XSLT template: $XSL" 1>&2 |
8e2d9b67b51c
xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
26 |
exit 1; |
8e2d9b67b51c
xslt: a basic XSLT template for XHTML output + helper scripts
František Kučera <franta-hg@frantovo.cz>
parents:
diff
changeset
|
27 |
fi |