Ignore:
Timestamp:
2011-04-11T16:55:18+12:00 (13 years ago)
Author:
sjm84
Message:

Modified several Perl files to merge the locations where XML::Parser checked for the current version of perl into one location. Also tidied up several locations where a difference was specified between 5.6 and 5.8+ to do with ProtocolEncoding being used to initialise an XML::Parser. Given the recent "

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/plugins/MetadataXMLPlugin.pm

    r23561 r23895  
    133133    }
    134134   
     135    # The following used to be passed in as a parameter to XML::Parser,
     136    # if the version of perl was greater than or equal to 5.8.
     137    # The svn commit comment explaining the reason for adding this was
     138    # not very clear and also said that it was quick fix and hadn't
     139    # been tested under windows.
     140    # More recent work has been to make strings in Perl "Unicode-aware"
     141    # and so this line might actually be potentially harmful, however
     142    # it is not the case that we encountered an actual error leading to
     143    # its removal, rather it has been eliminated in an attempt to tighten
     144    # up the code. For example, this protocol encoding is not used in
     145    # ReadXMLFile.
     146    # 'ProtocolEncoding' => 'ISO-8859-1',
     147
    135148    # create XML::Parser object for parsing metadata.xml files
    136     my $parser;
    137     if ($]<5.008) {
    138     # Perl 5.6
    139     $parser = new XML::Parser('Style' => 'Stream',
     149    my $parser = new XML::Parser('Style' => 'Stream',
    140150                                  'PluginObj' => $self,
     151                                  'Pkg' => 'MetadataXMLPlugin',
    141152                  'Handlers' => {'Char' => \&Char,
    142153                         'Doctype' => \&Doctype
    143154                         });
    144     }
    145     else {
    146     # Perl 5.8 or greater
    147     $parser = new XML::Parser('Style' => 'Stream',
    148                                   'PluginObj' => $self,
    149                   'ProtocolEncoding' => 'ISO-8859-1',
    150                   'Handlers' => {'Char' => \&Char,
    151                          'Doctype' => \&Doctype
    152                          });
    153     }
    154155
    155156    $self->{'parser'} = $parser;
Note: See TracChangeset for help on using the changeset viewer.