Changeset 21803


Ignore:
Timestamp:
2010-03-17T15:48:44+13:00 (14 years ago)
Author:
kjdon
Message:

set file_id to null if ID doesn't match FILE.* (previously it was ending up with mets: from the previous match

File:
1 edited

Legend:

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

    r17054 r21803  
    137137    $self->xml_dmd_start_tag (@_);
    138138    } elsif ($element =~ /^(mets:)?file$/) {
    139     $_{'ID'} =~ m/FILE(.*)/;
    140     $self->{'file_Id'} = $1;
     139    # only store the file_id for sections with text. Not for default ids (assoc files)
     140    if ($_{'ID'} =~ m/FILE(.*)/) {
     141        $self->{'file_Id'} = $1;
     142    }
     143    else {
     144        undef $self->{'file_Id'};
     145    }
    141146    } elsif ($element =~ /^(mets:)?FLocat$/){
    142147    #***deal with fileSection
     
    173178    my $section_num = $self->{'file_Id'};
    174179    return if (!defined $section_num);
    175     #**return if the section_num is not defined or not deal with the whole section (ID="default.*")
    176    
     180
    177181    $self->{'fileSec_table'}->{"$section_num"}=[];
    178182    $self->{'fileSec_table'}->{'section_num'}=$section_num;
Note: See TracChangeset for help on using the changeset viewer.