0c27b2a
diff -urNp xmlto-0.0.21-orig/format/xhtml1/dvi xmlto-0.0.21/format/xhtml1/dvi
0c27b2a
--- xmlto-0.0.21-orig/format/xhtml1/dvi	1970-01-01 01:00:00.000000000 +0100
0c27b2a
+++ xmlto-0.0.21/format/xhtml1/dvi	2009-03-16 12:30:34.000000000 +0100
0c27b2a
@@ -0,0 +1,13 @@
0c27b2a
+case "$1" in
0c27b2a
+stylesheet)
0c27b2a
+  if [ "$VERBOSE" -ge 1 ]
0c27b2a
+  then
0c27b2a
+    echo >&2 "Convert to XSL-FO"
0c27b2a
+  fi
0c27b2a
+  echo "http://www.antennahouse.com/XSLsample/sample-xsl-xhtml2fo/xhtml2fo.xsl"
0c27b2a
+  ;;
0c27b2a
+post-process)
0c27b2a
+  # Get the FO format script to do the rest
0c27b2a
+  sh "$(dirname "$0")/../fo/$(basename "$0")" "$1"
0c27b2a
+  ;;
0c27b2a
+esac
0c27b2a
diff -urNp xmlto-0.0.21-orig/format/xhtml1/fo xmlto-0.0.21/format/xhtml1/fo
0c27b2a
--- xmlto-0.0.21-orig/format/xhtml1/fo	1970-01-01 01:00:00.000000000 +0100
0c27b2a
+++ xmlto-0.0.21/format/xhtml1/fo	2009-03-16 12:30:34.000000000 +0100
0c27b2a
@@ -0,0 +1,12 @@
0c27b2a
+case "$1" in
0c27b2a
+stylesheet)
0c27b2a
+  if [ "$VERBOSE" -ge 1 ]
0c27b2a
+  then
0c27b2a
+    echo >&2 "Convert to XSL-FO"
0c27b2a
+  fi
0c27b2a
+  echo "http://www.antennahouse.com/XSLsample/sample-xsl-xhtml2fo/xhtml2fo.xsl"
0c27b2a
+  ;;
0c27b2a
+post-process)
0c27b2a
+  cp "$XSLT_PROCESSED" "$OUTPUT_DIR/$(basename ${XSLT_PROCESSED%.*}).fo"
0c27b2a
+  ;;
0c27b2a
+esac
0c27b2a
diff -urNp xmlto-0.0.21-orig/format/xhtml1/pdf xmlto-0.0.21/format/xhtml1/pdf
0c27b2a
--- xmlto-0.0.21-orig/format/xhtml1/pdf	1970-01-01 01:00:00.000000000 +0100
0c27b2a
+++ xmlto-0.0.21/format/xhtml1/pdf	2009-03-16 12:30:34.000000000 +0100
0c27b2a
@@ -0,0 +1,13 @@
0c27b2a
+case "$1" in
0c27b2a
+stylesheet)
0c27b2a
+  if [ "$VERBOSE" -ge 1 ]
0c27b2a
+  then
0c27b2a
+    echo >&2 "Convert to XSL-FO"
0c27b2a
+  fi
0c27b2a
+  echo "http://www.antennahouse.com/XSLsample/sample-xsl-xhtml2fo/xhtml2fo.xsl"
0c27b2a
+  ;;
0c27b2a
+post-process)
0c27b2a
+  # Get the FO format script to do the rest
0c27b2a
+  sh "$(dirname "$0")/../fo/$(basename "$0")" "$1"
0c27b2a
+  ;;
0c27b2a
+esac
0c27b2a
diff -urNp xmlto-0.0.21-orig/format/xhtml1/ps xmlto-0.0.21/format/xhtml1/ps
0c27b2a
--- xmlto-0.0.21-orig/format/xhtml1/ps	1970-01-01 01:00:00.000000000 +0100
0c27b2a
+++ xmlto-0.0.21/format/xhtml1/ps	2009-03-16 12:30:34.000000000 +0100
0c27b2a
@@ -0,0 +1,13 @@
0c27b2a
+case "$1" in
0c27b2a
+stylesheet)
0c27b2a
+  if [ "$VERBOSE" -ge 1 ]
0c27b2a
+  then
0c27b2a
+    echo >&2 "Convert to XSL-FO"
0c27b2a
+  fi
0c27b2a
+  echo "http://www.antennahouse.com/XSLsample/sample-xsl-xhtml2fo/xhtml2fo.xsl"
0c27b2a
+  ;;
0c27b2a
+post-process)
0c27b2a
+  # Get the FO format script to do the rest
0c27b2a
+  sh "$(dirname "$0")/../fo/$(basename "$0")" "$1"
0c27b2a
+  ;;
0c27b2a
+esac
0c27b2a
diff -urNp xmlto-0.0.21-orig/format/xhtml1/txt xmlto-0.0.21/format/xhtml1/txt
0c27b2a
--- xmlto-0.0.21-orig/format/xhtml1/txt	1970-01-01 01:00:00.000000000 +0100
0c27b2a
+++ xmlto-0.0.21/format/xhtml1/txt	2009-03-16 12:30:34.000000000 +0100
0c27b2a
@@ -0,0 +1,27 @@
0c27b2a
+if [ -x /usr/bin/w3m ]
0c27b2a
+then
0c27b2a
+  CONVERT=/usr/bin/w3m
0c27b2a
+  ARGS="-T text/html -dump"
0c27b2a
+elif [ -x /usr/bin/lynx ]
0c27b2a
+then
0c27b2a
+  CONVERT=/usr/bin/lynx
0c27b2a
+  ARGS="-force_html -dump -nolist -width=72"
0c27b2a
+elif [ -x /usr/bin/links ]
0c27b2a
+then
0c27b2a
+  CONVERT=/usr/bin/links
0c27b2a
+  ARGS="-dump"
0c27b2a
+else
0c27b2a
+  echo >&2 "No way to convert HTML to text found."
0c27b2a
+  exit 1
0c27b2a
+fi
0c27b2a
+
0c27b2a
+case "$1" in
0c27b2a
+post-process)
0c27b2a
+  if [ "$VERBOSE" -ge 1 ]
0c27b2a
+  then
0c27b2a
+    echo >&2 "Convert HTML to ASCII"
0c27b2a
+  fi
0c27b2a
+  ${CONVERT} ${ARGS} ${POSTARGS} ${XSLT_PROCESSED} > \
0c27b2a
+   "$OUTPUT_DIR/$(basename ${XSLT_PROCESSED%.*}).txt"
0c27b2a
+  ;;
0c27b2a
+esac
0c27b2a
diff -urNp xmlto-0.0.21-orig/Makefile.am xmlto-0.0.21/Makefile.am
0c27b2a
--- xmlto-0.0.21-orig/Makefile.am	2008-01-17 12:33:44.000000000 +0100
0c27b2a
+++ xmlto-0.0.21/Makefile.am	2009-03-16 12:49:27.000000000 +0100
0c27b2a
@@ -28,6 +28,11 @@ nobase_pkgdata_DATA = format/docbook/dvi
0c27b2a
   format/fo/pcl \
0c27b2a
   format/fo/svg \
0c27b2a
   format/fo/txt \
0c27b2a
+  format/xhtml1/dvi \
0c27b2a
+  format/xhtml1/fo \
0c27b2a
+  format/xhtml1/pdf \
0c27b2a
+  format/xhtml1/ps \
0c27b2a
+  format/xhtml1/txt \
0c27b2a
 	xmlto.mak
0c27b2a
 
0c27b2a
 EXTRA_DIST = xmlto.spec \
0c27b2a
@@ -56,6 +61,11 @@ EXTRA_DIST = xmlto.spec \
0c27b2a
   format/fo/pcl \
0c27b2a
   format/fo/svg \
0c27b2a
   format/fo/txt \
0c27b2a
+  format/xhtml1/dvi \
0c27b2a
+  format/xhtml1/fo \
0c27b2a
+  format/xhtml1/pdf \
0c27b2a
+  format/xhtml1/ps \
0c27b2a
+  format/xhtml1/txt \
0c27b2a
 	doc/xmlto.xml \
0c27b2a
 	doc/xmlif.xml \
0c27b2a
 	xmlto.mak \
0c27b2a
diff -urNp xmlto-0.0.21-orig/Makefile.in xmlto-0.0.21/Makefile.in
0c27b2a
--- xmlto-0.0.21-orig/Makefile.in	2008-05-30 15:57:32.000000000 +0200
0c27b2a
+++ xmlto-0.0.21/Makefile.in	2009-03-16 12:50:52.000000000 +0100
0c27b2a
@@ -208,6 +208,11 @@ nobase_pkgdata_DATA = format/docbook/dvi
0c27b2a
   format/fo/pcl \
0c27b2a
   format/fo/svg \
0c27b2a
   format/fo/txt \
0c27b2a
+  format/xhtml1/dvi \
0c27b2a
+  format/xhtml1/fo \
0c27b2a
+  format/xhtml1/pdf \
0c27b2a
+  format/xhtml1/ps \
0c27b2a
+  format/xhtml1/txt \
0c27b2a
 	xmlto.mak
0c27b2a
 
0c27b2a
 EXTRA_DIST = xmlto.spec \
0c27b2a
@@ -236,6 +241,11 @@ EXTRA_DIST = xmlto.spec \
0c27b2a
   format/fo/pcl \
0c27b2a
   format/fo/svg \
0c27b2a
   format/fo/txt \
0c27b2a
+  format/xhtml1/dvi \
0c27b2a
+  format/xhtml1/fo \
0c27b2a
+  format/xhtml1/pdf \
0c27b2a
+  format/xhtml1/ps \
0c27b2a
+  format/xhtml1/txt \
0c27b2a
 	doc/xmlto.xml \
0c27b2a
 	doc/xmlif.xml \
0c27b2a
 	xmlto.mak \
0c27b2a
diff -urNp xmlto-0.0.21-orig/xmlto.in xmlto-0.0.21/xmlto.in
0c27b2a
--- xmlto-0.0.21-orig/xmlto.in	2009-03-16 14:22:58.000000000 +0100
0c27b2a
+++ xmlto-0.0.21/xmlto.in	2009-03-16 12:27:49.000000000 +0100
0c27b2a
@@ -351,12 +351,15 @@ esac
0c27b2a
 #     sed -e 's/^]*?>//g' -e 's/^]*>//g' -e 's/^<\([^ ]*\).*$/\1/')
0c27b2a
 
0c27b2a
 # Seems reasonable fix the file command and teach it to identify the DTD/Schema but this is faster to write:
0c27b2a
-rootel=$(echo "xpath *" | xmllint --shell $INPUT_FILE  2> /dev/null |head -n 3 |tail -n 1 | cut -f 4 -d " " )
0c27b2a
+rootel=$(echo "xpath *" | xmllint --shell $INPUT_FILE  2> /dev/null | head -n 3 |tail -n 1 | cut -f 4 -d " " )
0c27b2a
 
0c27b2a
 case $(echo $rootel) in
0c27b2a
 fo:root)
0c27b2a
 	SOURCE_FORMAT="fo"
0c27b2a
 	;;
0c27b2a
+html)
0c27b2a
+	SOURCE_FORMAT="xhtml1"
0c27b2a
+	;;
0c27b2a
 esac
0c27b2a
 
0c27b2a
 [ "$VERBOSE" -ge 1 ] && echo >&2 "Source format: ${SOURCE_FORMAT} / root element: ${rootel} "