work on xml files as well as sgml files

This commit is contained in:
david 2002-05-05 20:29:12 +00:00
parent 4d602278cb
commit 0384d5b053
1 changed files with 7 additions and 7 deletions

View File

@ -3,13 +3,13 @@
# DESC: Script for creating an OMF (OpenSource Metadata Framework) file # DESC: Script for creating an OMF (OpenSource Metadata Framework) file
# from DocBook SGML. # from DocBook SGML.
# #
# USAGE: db2omf {-o <output_file>} <docbook_file>.sgml # USAGE: db2omf {-o <output_file>} <docbook_file>
# #
# Greg Ferguson <gferg@sgi.com> # Greg Ferguson <gferg@sgi.com>
# #
# See Changelog for the revision history. # See Changelog for the revision history.
$VERSION = '0.4'; $VERSION = '0.5';
# output stream flush # output stream flush
# #
@ -46,7 +46,7 @@ while(1) {
} }
if( $in_f eq '' ) { if( $in_f eq '' ) {
print "db2omf: ERROR <docbook_file>.sgml not specified.\n\n"; print "db2omf: ERROR <docbook_file> not specified.\n\n";
&usage(); &usage();
} elsif( !(-r $in_f) ) { } elsif( !(-r $in_f) ) {
print "db2omf: ERROR cannot read $f ($!)\n\n"; print "db2omf: ERROR cannot read $f ($!)\n\n";
@ -54,7 +54,7 @@ if( $in_f eq '' ) {
} }
if( $out_f eq '' ) { if( $out_f eq '' ) {
$in_f =~ /([^\/]+)\.sgml$/i; $in_f =~ /([^\/]+)\./i;
$out_f = $1 . ".omf"; $out_f = $1 . ".omf";
} }
@ -95,7 +95,7 @@ $_creator_template =" <creator created=\"%%DATE\">\n" .
$_creator_template =~ s/%%DATE/$_today/g; $_creator_template =~ s/%%DATE/$_today/g;
$_res_template =~ s/%%DATE/$_today/g; $_res_template =~ s/%%DATE/$_today/g;
&proc_sgml($in_f); &proc_file($in_f);
$_res_template =~ s/%%CREATOR/$_creator_template/; $_res_template =~ s/%%CREATOR/$_creator_template/;
$_res_template =~ s/%%SGML/$in_f/; $_res_template =~ s/%%SGML/$in_f/;
@ -115,7 +115,7 @@ exit(0);
# #
# #
# #
sub proc_sgml { sub proc_file {
my($f) = @_; my($f) = @_;
@ -448,7 +448,7 @@ sub get_date {
# #
# #
sub usage { sub usage {
print "\ndb2omf {-o <output_file>} <docbook_file>.sgml\n\n", print "\ndb2omf {-o <output_file>} <docbook_file>\n\n",
"db2omf - version $_vrs\n\n"; "db2omf - version $_vrs\n\n";
exit(0); exit(0);
} }