#!/bin/bash
# check - Validate Some XHTML 1.0 Subset Files
# Author: Sean B. Palmer, inamidst.com
# Usage: ./check
if ! which rnv &> /dev/null
then echo Requires RNV >&2
exit 1
fi
cd ${1:-.}
find -name '*.html' | \
while read LINE
do grep -q ' /tmp/rnv.$$.stdin
rnv -q ${2:-proj/quality/xhtml.rnc} /tmp/rnv.$$.stdin 2>&1 | \
grep error > /tmp/rnv.$$.stdout
echo "$? $LINE"
sed 's/^/ /' /tmp/rnv.$$.stdout
echo
rm /tmp/rnv.$$.stdin
rm /tmp/rnv.$$.stdout
done
# [EOF]