3 # pdf generation from xml and xsl
9 echo "usage: ${0##*/} <file.xsl> <file.xml>"
13 if [ -n "$XML_CATALOG_FILES" ]
15 CATALOG_FILES=$XML_CATALOG_FILES
17 echo "warning: XML_CATALOG_FILES is not set or empty"
18 CATALOG_FILES="/usr/local/etc/xml/catalog /etc/xml/catalog $HOME/xml/catalog"
20 KEY="http://docbook.sourceforge.net/release/xsl/current"
22 for CATALOG in $CATALOG_FILES
26 DOCBOOKXSLPATH=$(xmlcatalog "$CATALOG" "$KEY/")
28 if [ $? -ne 0 -o -z "$DOCBOOKXSLPATH" ]
30 DOCBOOKXSLPATH=$(xmlcatalog "$CATALOG" "$KEY")
32 test $? -ne 0 -o -z "$DOCBOOKXSLPATH" && \
36 test "${DOCBOOKXSLPATH:0:7}" == "file://" && \
37 DOCBOOKXSLPATH=${DOCBOOKXSLPATH:7}
38 if [ -n "$DOCBOOKXSLPATH" ]
40 echo "docbook-xsl path found: $DOCBOOKXSLPATH"
41 sed "s|@DOCBOOK_XSL_PATH@|$DOCBOOKXSLPATH|g" "$1" > sylpheed-claws-manual.xsl && \
42 saxon -o sylpheed-claws-manual.fo "$2" sylpheed-claws-manual.xsl && \
43 fop -fo sylpheed-claws-manual.fo -pdf sylpheed-claws-manual.pdf
48 echo "couldn't find docbook-xsl path from any of the following catalog files:"