-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathxbgf2html
More file actions
executable file
·25 lines (23 loc) · 974 Bytes
/
xbgf2html
File metadata and controls
executable file
·25 lines (23 loc) · 974 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/sh
# wiki: XBGF2HTML
if [ ! -r $1 ]; then
echo "Oops: $1 not found or not readable."
exit 1
fi
LOCAL=${PWD}
cd `dirname $0`
cd ../..
SLPS=${PWD}
cd `dirname ${LOCAL}/$1`
FULLPATH=${PWD}
cd ${LOCAL}
if [ $# -eq 2 ]; then
xsltproc --stringparam date `date +"%d/%m/%Y"` --stringparam fname `basename $1 .xbgf` --stringparam fullpath ${FULLPATH}/`basename $1` ${SLPS}/topics/export/hypertext/xbgf2xhtml.xslt $1 | grep -v 'DOCTYPE' > $2
elif [ $# -eq 3 ]; then
xsltproc --stringparam date `date +"%d/%m/%Y"` --stringparam fname `basename $1 .xbgf` --stringparam fullpath ${FULLPATH}/`basename $1` --stringparam gname $3 ${SLPS}/topics/export/hypertext/xbgf2xhtml.xslt $1 | grep -v 'DOCTYPE' > $2
else
echo "This tool transforms Transformational BGF documents to hypertext EBNF."
echo "Usage: xbgf2html <input-xbgf-document> <output-hypertext> [<hypertext-grammar>]"
echo "When grammar is not specified, the local file is used."
exit 1
fi