- Timestamp:
- 1998-12-21T15:16:15+13:00 (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/perllib/plugins/GMLPlug.pm
r75 r88 25 25 return 0; # this is not a recursive plugin 26 26 } 27 28 sub _unescape_text { 29 my ($text) = @_; 30 31 # special characters in the gml encoding 32 $text =~ s/</</g; 33 $text =~ s/>/>/g; 34 $text =~ s/"/\"/g; 35 $text =~ s/&/&/g; # this has to be last... 36 37 return $text; 38 } 39 27 40 28 41 # return 1 if processed, 0 if not processed … … 63 76 my $tags = $1; 64 77 $tags = "" unless defined $tags; 65 my $text = $2;78 my $text = &_unescape_text($2); 66 79 67 80 # create the section (unless this is the first section) … … 79 92 # add the tags 80 93 while ((defined $tags) && ($tags =~ s/^\s*(\w+)\s*=\s*\"([^\"]*)\"//)) { 81 $doc_obj->add_utf8_metadata($section, $1 , $2) if (defined $1 and defined $2); 94 $doc_obj->add_utf8_metadata($section, $1 , &_unescape_text($2)) 95 if (defined $1 and defined $2); 82 96 } 83 97 84 98 # add the text 85 $doc_obj->add_utf8_text($section, $text) if ((defined $text) && ($text ne "")); 99 $doc_obj->add_utf8_text($section, $text) 100 if ((defined $text) && ($text ne "")); 86 101 87 102 } elsif ($gml =~ s/^\s*<\/gsdlsection>//) {
Note:
See TracChangeset
for help on using the changeset viewer.