summaryrefslogtreecommitdiff
path: root/2005/flow-accounting-lt2005/ltpdk/bin/lt-validate
blob: f56bdbed8c711de1dabaaad28dbba45fc152b2f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/sh
#
# lt-validate - validates an XML/DocBook document of LinuxTag flavour.
#
# LinuxTag Paper Development Kit is Copyright (C) 2003 by LinuxTag e. V.
#
# V1.2 written 2003-05-04 by Nils Magnus (magnus@linuxtag.org)
# 

# check options
if [ -z "$1" ]
then
    cat << EOF
Usage: $0 file
Validates XML/DocBook file.
EOF
    exit 1
fi

# determine paths

bin=`echo $0 | sed 's/[^/]*$//'`

if echo ${bin} | grep -v '^/' > /dev/null
then
   bin="`pwd`/${bin}"
fi

xml=`echo ${bin} | sed 's/bin.*$/xml/'`

# call xmllint

if ${bin}/xmllint --dtdvalid ${xml}/docbook.dtd $*
then
    echo "Document is conforming to spec. You may want to check the results with lt-convert."
else
    echo "Summary: Document is not conforming to spec."
fi
personal git repositories of Harald Welte. Your mileage may vary