- Timestamp:
- 2010-04-19T14:05:50+12:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/plugins/MetadataXMLPlugin.pm
r20803 r21905 115 115 'args' => $arguments }; 116 116 117 my ($self);118 119 117 sub new { 120 118 my ($class) = shift (@_); … … 125 123 push(@{$hashArgOptLists->{"OptList"}},$options); 126 124 127 $self = new BasePlugin($pluginlist, $inputargs, $hashArgOptLists);125 my $self = new BasePlugin($pluginlist, $inputargs, $hashArgOptLists); 128 126 129 127 if ($self->{'info_only'}) { … … 137 135 # Perl 5.6 138 136 $parser = new XML::Parser('Style' => 'Stream', 137 'PluginObj' => $self, 139 138 'Handlers' => {'Char' => \&Char, 140 139 'Doctype' => \&Doctype … … 144 143 # Perl 5.8 145 144 $parser = new XML::Parser('Style' => 'Stream', 145 'PluginObj' => $self, 146 146 'ProtocolEncoding' => 'ISO-8859-1', 147 147 'Handlers' => {'Char' => \&Char, … … 220 220 } 221 221 222 sub Doctype { 222 223 # Updated by Jeffrey 2010/04/16 @ DL Consulting Ltd. 224 # Get rid off the global $self as it cause problems when there are 2+ MetadataXMLPlugin in your collect.cfg... 225 # For example when you have an OAIMetadataXMLPlugin that is a child of MetadataXMLPlugin 226 sub Doctype {$_[0]->{'PluginObj'}->xml_doctype(@_);} 227 sub StartTag {$_[0]->{'PluginObj'}->xml_start_tag(@_);} 228 sub EndTag {$_[0]->{'PluginObj'}->xml_end_tag(@_);} 229 sub Text {$_[0]->{'PluginObj'}->xml_text(@_);} 230 231 232 sub xml_doctype { 233 my $self = shift(@_); 223 234 my ($expat, $name, $sysid, $pubid, $internal) = @_; 224 235 … … 229 240 } 230 241 231 sub StartTag { 242 sub xml_start_tag { 243 my $self = shift(@_); 232 244 my ($expat, $element) = @_; 233 245 … … 250 262 } 251 263 252 sub EndTag { 264 sub xml_end_tag { 265 my $self = shift(@_); 253 266 my ($expat, $element) = @_; 254 267 … … 291 304 } 292 305 293 sub Text { 306 sub xml_text { 307 my $self = shift(@_); 294 308 295 309 if ($self->{'in_filename'}) {
Note:
See TracChangeset
for help on using the changeset viewer.