- Timestamp:
- 2011-04-11T16:55:18+12:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/plugins/MetadataXMLPlugin.pm
r23561 r23895 133 133 } 134 134 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 135 148 # 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', 140 150 'PluginObj' => $self, 151 'Pkg' => 'MetadataXMLPlugin', 141 152 'Handlers' => {'Char' => \&Char, 142 153 'Doctype' => \&Doctype 143 154 }); 144 }145 else {146 # Perl 5.8 or greater147 $parser = new XML::Parser('Style' => 'Stream',148 'PluginObj' => $self,149 'ProtocolEncoding' => 'ISO-8859-1',150 'Handlers' => {'Char' => \&Char,151 'Doctype' => \&Doctype152 });153 }154 155 155 156 $self->{'parser'} = $parser;
Note:
See TracChangeset
for help on using the changeset viewer.