#!/bin/bash

# Let's call the KDE catalog first
export XML_CATALOG_FILES="/usr/share/apps/ksgmltools2/customization/catalog.xml"

# Check if docbook is well formed
echo "Running checkXML... ";
checkXML $1;
if [ $? -gt 0 ]; then
  echo " -> checkXML failed !";
  exit 1;
fi
echo " -> OK !";

# Convert to html
echo "Running xsltproc... ";
xsltproc -o $2 /usr/share/apps/ksgmltools2/customization/kde-nochunk.xsl $1;
if [ $? -gt 0 ]; then
  echo " -> xsltproc failed !";
  exit 1;
else
  echo " -> OK !";
fi


exit 0;
