2 # see the README file for usage etc.
4 # ------------------------------------------------------------------
5 # This file is part of bzip2/libbzip2, a program and library for
6 # lossless, block-sorting data compression.
8 # bzip2/libbzip2 version 1.0.5 of 10 December 2007
9 # Copyright (C) 1996-2007 Julian Seward <jseward@bzip.org>
11 # Please read the WARNING, DISCLAIMER and PATENTS sections in the
14 # This program is released under the terms of the license contained
15 # in the file LICENSE.
16 # ----------------------------------------------------------------
21 echo 'Usage: xmlproc.sh -[option] <filename.xml>';
22 echo 'Specify a target from:';
23 echo '-v verify xml file conforms to dtd';
24 echo '-html output in html format (single file)';
25 echo '-ps output in postscript format';
26 echo '-pdf output in pdf format';
30 if test $# -ne 2; then
33 # assign the variable for the output type
35 # assign the output filename
37 # and check user input it correct
38 if !(test -f $xmlfile); then
39 echo "No such file: $xmlfile";
42 # some other stuff we will use
48 basename=${basename//'.xml'/''}
50 fofile
="${basename}.fo"
51 htmlfile
="${basename}.html"
52 pdffile
="${basename}.pdf"
53 psfile
="${basename}.ps"
54 xmlfmtfile
="${basename}.fmt"
56 # first process the xmlfile with CDATA tags
57 .
/format.pl
$xmlfile $xmlfmtfile
58 # so the shell knows where the catalogs live
59 export XML_CATALOG_FILES
=/etc
/xml
/catalog
61 # post-processing tidy up
63 echo "Cleaning up: $@"
67 echo " deleting $arg";
74 flags
='--noout --xinclude --noblanks --postvalid'
75 dtd
='--dtdvalid http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd'
76 xmllint
$flags $dtd $xmlfmtfile 2> $OUT
82 echo "Creating $htmlfile ..."
83 xsltproc
--nonet --xinclude -o $htmlfile $xsl_html $xmlfmtfile
88 echo "Creating $pdffile ..."
89 xsltproc
--nonet --xinclude -o $fofile $xsl_fo $xmlfmtfile
90 pdfxmltex
$fofile >$OUT </dev
/null
91 pdfxmltex
$fofile >$OUT </dev
/null
92 pdfxmltex
$fofile >$OUT </dev
/null
93 cleanup
$OUT $xmlfmtfile *.aux
*.fo
*.log
*.out
97 echo "Creating $psfile ..."
98 xsltproc
--nonet --xinclude -o $fofile $xsl_fo $xmlfmtfile
99 pdfxmltex
$fofile >$OUT </dev
/null
100 pdfxmltex
$fofile >$OUT </dev
/null
101 pdfxmltex
$fofile >$OUT </dev
/null
102 pdftops
$pdffile $psfile
103 cleanup
$OUT $xmlfmtfile $pdffile *.aux
*.fo
*.log
*.out
104 # passivetex is broken, so we can't go this route yet.
105 # xmltex $fofile >$OUT </dev/null
106 # xmltex $fofile >$OUT </dev/null
107 # xmltex $fofile >$OUT </dev/null
108 # dvips -R -q -o bzip-manual.ps *.dvi