entResolver 1.2 KB

1234567891011121314151617181920212223242526272829
  1. #!/bin/bash
  2. ###############################################################################
  3. # #
  4. # File: entResolver #
  5. # #
  6. # Description: Works around libxml2 bug 135713 by preprocessing entity #
  7. # references before performing any stylesheet processing. #
  8. # #
  9. # Author: Manuel Canales Esparcia #
  10. # #
  11. ###############################################################################
  12. NAME=`basename "$0"`
  13. DESTDIR="$1"
  14. if [ -z "$1" ]; then
  15. echo "USAGE: $NAME destdir"
  16. exit
  17. fi
  18. mkdir -p ../"$DESTDIR"/chapter0{1,2,3,4,5,6,7,8,9}
  19. mkdir -p ../"$DESTDIR"/prologue
  20. mkdir -p ../"$DESTDIR"/appendix{a,b}
  21. for i in `find . -name "*.xml"`; do
  22. xmllint --nonet --noent "${i}" > ../"$DESTDIR"/"${i}";
  23. done
  24. cp -a stylesheets ../"$DESTDIR"