Ignore:
Timestamp:
2009-05-29T14:01:58+12:00 (15 years ago)
Author:
kjdon
Message:

if we are doing a mapping from a field with no subfield spacified, then we concatenate the values of all the subfields, separated by space. Have made it only add space between entries, not at the end of each entry (and therefore always a space at the end)

File:
1 edited

Legend:

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

    r19619 r19672  
    347347    my $doc_obj = $self->{'doc_obj'};
    348348
    349 ##  print STDERR "**** Marc Record\n";
    350 ##      map { print STDERR $_."=>".$marc_mapping->{$_}."\n"; } keys %$marc_mapping;
    351 ##  print STDERR "**** Metadata Mapping\n";
    352 ##      map { print STDERR $_."=>".$metadata_mapping->{$_}."\n"; } keys %$metadata_mapping;
     349    ##print STDERR "**** Marc Record\n";
     350      ##map { print STDERR $_."=>".$marc_mapping->{$_}."\n"; } keys %$marc_mapping;
     351    ##print STDERR "**** Metadata Mapping\n";
     352      ##map { print STDERR $_."=>".$metadata_mapping->{$_}."\n"; } keys %$metadata_mapping;
    353353
    354354
     
    383383           
    384384            # no subfield => get all the values
     385            my $first = 1;
    385386            foreach my $value (sort keys %{$matched_field}) {
    386             $meta_value .= $matched_field->{$value} ." ";
     387            if ($first) {
     388                $meta_value = $matched_field->{$value};
     389                $first = 0;
     390            } else {
     391                $meta_value .= " " . $matched_field->{$value};
     392            }
    387393            }
    388394
Note: See TracChangeset for help on using the changeset viewer.