--- messaging/manakai/bin/daf.pl 2006/11/04 12:25:10 1.18 +++ messaging/manakai/bin/daf.pl 2006/11/05 12:31:49 1.20 @@ -1,18 +1,13 @@ #!/usr/bin/perl -w use strict; use Message::Util::QName::Filter { - c => q, - DIS => q, dis => q, dp => q, - fe => q, ManakaiDOM => q, - pc => q, swcfg21 => q, - Util => q, }; -our$VERSION=do{my @r=(q$Revision: 1.18 $=~/\d+/g);sprintf "%d."."%02d" x $#r,@r}; +our$VERSION=do{my @r=(q$Revision: 1.20 $=~/\d+/g);sprintf "%d."."%02d" x $#r,@r}; use Cwd; use Getopt::Long; use Pod::Usage; @@ -133,44 +128,36 @@ print STDERR $s if $Opt{verbose}; } +sub daf_open_source_dis_document ($); +sub daf_open_current_module_index ($$); +sub daf_convert_dis_document_to_dnl_document (); +sub daf_get_referring_module_uri_list ($); +sub dac_search_file_path_stem ($$$); +sub daf_get_module_index_file_name ($); +sub daf_check_undefined (); + ## ---- The MAIN Program my $start_time; BEGIN { $start_time = time } -use Message::Util::DIS::DNLite; - -my %feature; +use Message::DOM::DOMCore; for (@{$Opt{create_module}}) { my (undef, undef, undef, $out_type) = @$_; if ($out_type eq 'perl-pm') { require 'manakai/daf-perl-pm.pl'; - $feature{'+' . ExpandedURI q} = '1.0'; } elsif ($out_type eq 'perl-t') { require 'manakai/daf-perl-t.pl'; - $feature{ExpandedURI q} = '3.0'; - $feature{'+' . ExpandedURI q} = '1.0'; - $feature{'+' . ExpandedURI q} = '1.0'; } elsif ($out_type eq 'dtd-modules') { require 'manakai/daf-dtd-modules.pl'; - $feature{ExpandedURI q} = '3.0'; - $feature{'+' . ExpandedURI q} = '3.0'; } elsif ($out_type eq 'dtd-driver') { require 'manakai/daf-dtd-modules.pl'; - $feature{ExpandedURI q} = '3.0'; - $feature{'+' . ExpandedURI q} = '3.0'; } } -our $limpl = $Message::DOM::ImplementationRegistry->get_implementation - ({ExpandedURI q => '3.0', - '+' . ExpandedURI q => '1.0', - '+' . ExpandedURI q => '1.0', - %feature, - }); -our $impl = $limpl->get_feature (ExpandedURI q => '1.0'); +our $impl = $Message::DOM::ImplementationRegistry->get_implementation; ## --- Loading and Updating the Database @@ -180,7 +167,6 @@ $db->dom_config->set_parameter ('error-handler' => \&daf_on_error); my $parser = $impl->create_dis_parser; -my $DNi = $impl->get_feature (ExpandedURI q => '1.0'); my %ModuleSourceDISDocument; my %ModuleSourceDNLDocument; my %ModuleNameNamespaceBinding = ( @@ -194,7 +180,7 @@ $db->pl_update_module (\@target_modules, get_module_index_file_name => sub { shift; # $db - daf_get_module_index_file_name (@_); + daf_get_module_index_file_name (shift); }, get_module_source_document_from_uri => sub { my ($db, $module_uri, $module_for) = @_; @@ -307,7 +293,6 @@ daf_check_undefined (); -undef $DNi; undef %ModuleSourceDNLDocument; exit $HasError if $HasError; @@ -336,7 +321,6 @@ undef $db; status_msg "done"; -undef $limpl; undef $impl; { @@ -429,7 +413,7 @@ my $dis_doc = $ModuleSourceDISDocument{$module_uri}; next M unless $dis_doc; verbose_msg_ qq...>; - my $dnl_doc = $DNi->convert_dis_document_to_dnl_document + my $dnl_doc = $impl->convert_dis_document_to_dnl_document ($dis_doc, database_arg => $db, base_namespace_binding => {(map {$_->local_name => $_->target_namespace_uri} @@ -488,7 +472,7 @@ return undef; } # dac_search_file_path_stem; -sub daf_get_module_index_file_name ($$) { +sub daf_get_module_index_file_name ($) { my ($module_uri) = @_; my $ns = $module_uri; $ns =~ s/(\w+)\z//;