aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/entResolver
blob: e04f439b36bf0abedc9f2221494450aaf6226582 (plain)
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
26
27
28
29
#!/bin/bash
###############################################################################
#                                                                             #
# File:        entResolver                                                    #
#                                                                             #
# Description: Works around libxml2 bug 135713 by preprocessing entity        #
#              references before performing any stylesheet processing.        #
#                                                                             #
# Author:      Manuel Canales Esparcia                                        #
#                                                                             #
###############################################################################

NAME=`basename "$0"`
DESTDIR="$1"

if [ -z "$1" ]; then
        echo "USAGE: $NAME destdir"
        exit
fi

mkdir -p ../"$DESTDIR"/chapter0{1,2,3,4,5,6,7,8,9}
mkdir -p ../"$DESTDIR"/prologue
mkdir -p ../"$DESTDIR"/appendix{a,b}

for i in `find . -name "*.xml"`; do
        xmllint --nonet --noent "${i}" > ../"$DESTDIR"/"${i}";
done

cp -a stylesheets ../"$DESTDIR"