Skip to content

Commit

Permalink
making XBGF2HTML exporter fancier and up to date
Browse files Browse the repository at this point in the history
git-svn-id: https://slps.svn.sourceforge.net/svnroot/slps@1052 ab42f6e0-554d-0410-b580-99e487e6eeb2
  • Loading branch information
grammarware committed May 25, 2011
1 parent da999b3 commit f6e9cd0
Show file tree
Hide file tree
Showing 3 changed files with 561 additions and 598 deletions.
27 changes: 14 additions & 13 deletions shared/tools/xbgf2html
@@ -1,24 +1,25 @@
#!/bin/sh

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 1 ]; then
OUTPUT=/dev/stdout
elif [ $# -ne 2 ]; then
echo "This tool transforms Transformational BGF documents to hypertext EBNF."
echo "Usage: xbgf2html <input-xbgf-document> [<output-hypertex>]"
echo "When output file is not specified, stdout is used."
exit 1
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
OUTPUT=$2
fi
if [ ! -r $1 ]; then
echo "Oops: $1 not found or not readable."
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

xsltproc ${SLPS}/topics/export/hypertext/xbgf2xhtml.xslt $1 | grep -v 'DOCTYPE' > ${OUTPUT}

0 comments on commit f6e9cd0

Please sign in to comment.