Changeset 13172 for trunk/gsdl/perllib/plugouts/GAPlugout.pm
- Timestamp:
- 2006-10-27T13:41:01+13:00 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/perllib/plugouts/GAPlugout.pm
r12363 r13172 28 28 use strict; 29 29 no strict 'refs'; 30 no strict 'subs'; 30 31 31 32 eval {require bytes}; 32 33 use util; 33 34 use BasPlugout; 35 use docprint; 34 36 35 37 sub BEGIN { … … 61 63 my ($doc_obj,$doc_dir) = @_; 62 64 63 my $output_dir = $self->get_output_dir(); 64 &util::mk_all_dir ($output_dir) unless -e $output_dir; 65 66 my $working_dir = &util::filename_cat ($output_dir, $doc_dir); 67 &util::mk_all_dir ($working_dir) unless -e $working_dir; 68 69 $self->process_assoc_files ($doc_obj, $doc_dir, ''); 70 71 my $output_file = util::filename_cat ($working_dir, "doc.xml"); 72 73 $self->open_xslt_pipe($output_file, $self->{'xslt_file'}); 74 75 my $outhandler; 76 77 if (defined $self->{'xslt_writer'}){ 78 $outhandler = $self->{'xslt_writer'}; 65 my $outhandler; 66 if ($self->{'debug'}) { 67 $outhandler = STDOUT; 68 # can we do the xslt and still do debug mode? 69 } 70 else { 71 my $output_dir = $self->get_output_dir(); 72 &util::mk_all_dir ($output_dir) unless -e $output_dir; 73 74 my $working_dir = &util::filename_cat ($output_dir, $doc_dir); 75 &util::mk_all_dir ($working_dir) unless -e $working_dir; 76 77 $self->process_assoc_files ($doc_obj, $doc_dir, ''); 78 79 my $output_file = util::filename_cat ($working_dir, "doc.xml"); 80 81 $self->open_xslt_pipe($output_file, $self->{'xslt_file'}); 82 83 84 if (defined $self->{'xslt_writer'}){ 85 $outhandler = $self->{'xslt_writer'}; 86 } 87 else{ 88 $outhandler = $self->get_output_handler($output_file); 89 } 79 90 } 80 else{ 81 $outhandler = $self->get_output_handler($output_file); 82 } 83 91 84 92 $self->output_xml_header($outhandler,"Archive"); 85 $doc_obj->output_section($outhandler,$doc_obj->get_top_section()); 93 my $section_output = &docprint::get_section_xml($doc_obj, $doc_obj->get_top_section()); 94 print $outhandler $section_output; 86 95 $self->output_xml_footer($outhandler,"Archive"); 87 96 88 if (defined $self->{'xslt_writer'}){ 89 $self->close_xslt_pipe(); 97 if (!$self->{'debug'}) { 98 if (defined $self->{'xslt_writer'}){ 99 $self->close_xslt_pipe(); 100 } 101 else { 102 close($outhandler); 103 } 104 105 $self->{'short_doc_file'} = util::filename_cat ($doc_dir, "doc.xml"); 106 107 $self->store_output_info_reference($doc_obj); 90 108 } 91 else{ 92 close($outhandler); 93 } 109 } 94 110 95 $self->{'short_doc_file'} = util::filename_cat ($doc_dir, "doc.xml"); 96 97 $self->store_output_info_reference($doc_obj); 98 } 111 99 112 100 113 1;
Note:
See TracChangeset
for help on using the changeset viewer.