13
GetOptions("dtd:s" => \$DTD,
15
"out-dir:s" => \$OUT_DIR,
16
"stub-ok+" => \$STUB_OK,
19
foreach my $file (@ARGV) {
21
my $base = basename($file);
23
my $xml = $OUTFILE || "$OUT_DIR/$base.xml";
24
my $schemaName = undef;
26
open(IFD, "<$file") || die;
27
open(OFD, ">$xml") || die;
28
print OFD "<!DOCTYPE class SYSTEM \"$DTD\">\n";
29
print OFD "<class>\n";
35
# NOTE! Keep this in sync with the similar block in generate-entities.php
36
# and generate-maps.php
37
if (m|<class-name>(.*)</class-name>|) {
38
($schemaName = $1) =~ s/^Gallery//;
39
# Shorten some table names to fit Oracle's 30 char name limit..
40
$schemaName =~ s/Preferences/Prefs/;
41
$schemaName =~ s/Toolkit/Tk/;
42
$schemaName =~ s/TkOperation/TkOperatn/;
46
print OFD "<schema-name>$schemaName</schema-name>\n";
51
print OFD "</class>\n";
54
# It's gotta have more than the class-name, schema-version tags.
56
if ($tagCount == 0 || ($tagCount <= 2 && !$STUB_OK)) {
57
print STDERR "No tags detected\n" unless ($QUIET);