MHonArc v2.5.0b2 -->
docbook-tc message
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
| [List Home]
Subject: Re: [docbook-tc] DocBook Technical Committee Meeting Agenda: 15 December 2004
Bob Stayton <bobs@sagehill.net> writes:
> b. Mike to write up the DTD test suite process.
Intead of writing up the process, I just wrote a script. See attached.
It's also at:
http://docbook.sourceforge.net/outgoing/docbook-dtd-test
You need to have cvs, wget, unzip, sed, and xmllint installed to make it work.
Here is an example of how to run it, and output from it:
msmith@sideshowbarker ~
$ /sandbox/cvstools/docbook-dtd-test -t /scratch http://www.docbook.org/xml/4.4CR2/docbook-xml-4.4CR2.zip
Not valid: informalequation-mml.001.xml
Not valid: mathml.001.xml
Not valid: productionset.001.xml
Not valid: productionset.002.xml
Not valid: productionset.003.xml
Not valid: productionset.004.xml
Not valid: productionset.005.xml
Not valid: productionset.006.xml
Not valid: svg.001.xml
Not valid: template.xml
The template.xml file is not valid by design. And the other files
are all invalid because the don't reference the correct DTD
customizations (MathML, EBNF, SVG modules).
--Mike
#!/bin/sh
# $Id: docbook-dtd-test,v 1.1 2004/12/15 21:37:17 xmldoc Exp $
TEMPDIR=/tmp
CVS=cvs
CVS_OPTS='-Q'
WGET=wget
WGET_OPTS='-q'
UNZIP=unzip
UNZIP_OPTS='-q'
SED=sed
SED_OPTS=
XMLLINT=xmllint
XMLLINT_OPTS='--noout --nonet --postvalid --nowarning --xinclude'
usage="Usage:
`basename $0` [-t TEMPDIR] [-v] URI
"
opts_admon="Type '`basename $0` -h' for details about options.
"
help="Options:
-t TEMPDIR Specifies temporary directory (default: /tmp)
-v Specifies verbose output for validation phase
URI Location of zip file containing DocBook DTD to validate against
Example:
`basename $0` -v -t /scratch http://www.docbook.org/xml/4.4CR2/docbook-xml-4.4CR2.zip
"
while getopts "ht:v" opt; do
case $opt in
h ) printf "$usage"
printf "$help"
exit 0 ;;
t ) TEMPDIR=$OPTARG ;;
v ) VERBOSE=Yes ;;
\? ) printf "$usage"
printf "$opts_admon"
exit 1 ;;
esac
done
shift $(($OPTIND - 1))
if [ "$1" = "" ]; then
echo "`basename $0`: Error - no URI specified"
printf "$usage"
printf "$opts_admon"
exit 1
fi
cd $TEMPDIR
$CVS $CVS_OPTS -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/docbook co testdocs
zipfile=`basename $1`
unzip_dir=`basename $1 .zip`
url_base=`dirname $1`
version=`basename $url_base`
rm -rf $unzip_dir
mkdir $unzip_dir
cd $unzip_dir
$WGET $WGET_OPTS $1
$UNZIP $UNZIP_OPTS `basename $1`
XML_CATALOG_FILES=$TEMPDIR/$unzip_dir/catalog.xml
export XML_CATALOG_FILES
cd $TEMPDIR/testdocs/tests
for file in `find . -name "*.xml" | cut -c3-`; do
if [ "$VERBOSE" = "Yes" ]; then
$SED $SED_OPTS "s#/[^/]\+/docbookx.dtd#/$version/docbookx.dtd#" $file \
| $XMLLINT $XMLLINT_OPTS -
else
$SED $SED_OPTS "s#/[^/]\+/docbookx.dtd#/$version/docbookx.dtd#" $file \
| $XMLLINT $XMLLINT_OPTS - 1>/dev/null 2>&1
fi
if [ $? != "0" ] ; then
echo "Not valid: $file"
if [ "$VERBOSE" = "Yes" ]; then
echo
fi
fi
done
cd $TEMPDIR
rm -rf testdocs
rm -rf $unzip_dir
smime.p7s
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
| [List Home]