#!/usr/local/bin/perl
# Verify the following in the sample style sheet:
# 1) All properties are correct
# 2) All properties are represented
# Ian Jacobs - ij@w3.org
# $Id: chksample,v 1.5 2006-10-09 18:55:52 ihickson Exp $
# To use long names like $INPUT_RECORD_SEPARATOR.
use English;
$PROGNAME = substr($0, rindex($0, "/") + 1);
if (!$ARGV[0] || !$ARGV[1]) {
print "Usage: $PROGNAME style_sheet propertydb\n";
exit 1;
} else {
$style = $ARGV[0];
shift;
$propdbf = $ARGV[0];
shift;
}
if (($_ = $ARGV[0], /^-e/) && $ARGV[1]) {
shift;
$elements = $ARGV[1];
shift;
} else {
$elements = "";
}
# regexps
$sp = "[ \t\n]*"; # whitespace
$propname = "[a-zA-Z-]+";
$propval = "[a-zA-Z0-9.-]+";
$patt = "$sp(.*?)$sp";
$blockst = "[/][*]";
$blocket = "[*][/]";
sub readdbfile {
if (!open(DBASE, $_[0])) {
print STDERR "$PROGNAME Error: Cannot open dbfile: $_[0]\n";
return;
}
$dbbuf = "";
while (