Changeset 863


Ignore:
Timestamp:
2000-01-25T10:48:29+13:00 (22 years ago)
Author:
sjboddie
Message:

fixed a couple of bugs that I introduced when including Davids stuff

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/perllib/plugins/GMLPlug.pm

    r862 r863  
    136136        # create the section (unless this is the first section)
    137137        if ($firstsection) {
    138             $firstsection = 0;
     138            $firstsection = 0;
    139139#           $tags =~ /gsdlsourcefilename\s*=\s*(?:\"([^\"]*)\")/o;
    140140#           $src_filename = $2 || $3;
     
    152152       
    153153        # add the tags
    154         while ((defined $tags) && ($tags =~ s/^\s*(\w+)=\"([^\"]*)\"//o)) {
     154        while ((defined $tags) && ($tags =~ s/^\s*(\S+)=\"([^\"]*)\"//o)) {
    155155            $doc_obj->add_utf8_metadata($section, $1, &GMLPlug::_unescape_text($2))
    156156            if (defined $1 and defined $2);
     157
    157158        }
    158159       
     
    164165        $gml = shift(@gml_sections); # get next bit of data
    165166        last unless defined $gml;
     167        last if $section eq ""; # back to top level again (more than one document in gml file)
    166168        $section = $doc_obj->get_parent_section ($section);
    167         last if $section eq ""; # back to top level again (more than one document in gml file)
    168169    }
    169170
     
    179180    $doc_obj->delete_metadata($doc_obj->get_top_section(), "gsdlassocfile");
    180181   
    181     # add metadata
    182     foreach $field (keys(%$metadata)) {
    183         # $metadata->{$field} may be an array reference
    184         if (ref ($metadata->{$field}) eq "ARRAY") {
    185         map {
    186             $doc_obj->add_metadata ($doc_obj->get_top_section(), $field, $_);
    187         } @{$metadata->{$field}};
    188         } else {
    189         $doc_obj->add_metadata ($doc_obj->get_top_section(), $field, $metadata->{$field});
    190         }
    191     }
     182    # add metadata passed in from elsewhere
     183    $self->extra_metadata ($doc_obj, $doc_obj->get_top_section(), $metadata);
    192184   
    193185    # assume the document has an OID
Note: See TracChangeset for help on using the changeset viewer.