aboutsummaryrefslogtreecommitdiff
path: root/test/pddp/topdf
diff options
context:
space:
mode:
Diffstat (limited to 'test/pddp/topdf')
-rwxr-xr-xtest/pddp/topdf23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/pddp/topdf b/test/pddp/topdf
new file mode 100755
index 0000000..adf4b43
--- /dev/null
+++ b/test/pddp/topdf
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+usage () {
+ cat << EOF
+usage: topdf <pddpsource>.xml
+EOF
+}
+
+[ "$#" == 0 ] && { usage; exit 1; }
+
+SOURCE_NAME="$(basename $1)"
+SOURCE_STUB="$(basename $SOURCE_NAME .xml)"
+
+[ $SOURCE_STUB == $SOURCE_NAME ] && { usage; exit 1; }
+
+xmllint >/dev/null --xinclude --postvalid $1
+xsltproc --nonet --xinclude \
+ -o "$SOURCE_STUB.fo" \
+ /usr/share/xml/docbook/stylesheet/nwalsh/fo/docbook.xsl \
+ $1
+
+# FIXME need to run this twice, it should be check-wrapped too
+pdfxmltex "$SOURCE_STUB.fo"