xref: /titanic_41/usr/src/cmd/hal/tools/hal-fdi-validate.sh (revision ea394cb00fd96864e34d2841b4a22357b621c78f)
1#
2# hal-fdi-validate.sh : Validate one or more fdi(4) files
3#
4# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
5# Use is subject to license terms.
6#
7# Licensed under the Academic Free License version 2.1
8#
9# ident	"%Z%%M%	%I%	%E% SMI"
10#
11
12usage() {
13	echo "Usage: hal-fdi-validate [-f dtd] file [file ...]"
14	exit 1
15}
16
17if [ "$1" = "-f" ]; then
18	if [ "foo$2" != "foo" ] ; then
19		DTD="$2"
20		shift 2
21	else
22		usage
23	fi
24else
25	DTD="/usr/share/lib/xml/dtd/fdi.dtd.1"
26fi
27
28if [ $# -eq 0 ]; then
29	usage
30fi
31
32xmllint --noout --dtdvalid $DTD $*
33