Changeset 22349

Show
Ignore:
Timestamp:
05.07.2010 15:46:54 (9 years ago)
Author:
kjdon
Message:

if metadata extracted from item file has a namespace, then prefix it with ex. so that it shows up in GLI

Files:
1 modified

Legend:

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

    r21721 r22349  
    472472    $self->{'current_section'} = $doc_obj->get_parent_section($self->{'current_section'}); 
    473473    } elsif ($element eq "Metadata") { 
    474      
    475     $doc_obj->add_utf8_metadata ($self->{'current_section'}, $self->{'metadata_name'}, $self->{'metadata_value'}); 
     474    my $meta_name = $self->{'metadata_name'}; 
     475    if ($meta_name =~ /\./) { 
     476        $meta_name = "ex.$meta_name"; 
     477    } 
     478    $doc_obj->add_utf8_metadata ($self->{'current_section'}, $meta_name, $self->{'metadata_value'}); 
    476479    $self->{'metadata_name'} = ""; 
    477480    $self->{'metadata_value'} = ""; 
     
    565568    next if $line =~ /^#/; # ignore comment lines 
    566569    if ($line =~ /^<([^>]*)>\s*(.*?)\s*$/) { 
    567         $doc_obj->set_utf8_metadata_element ($topsection, $1, $2); 
     570        my $meta_name = $1; 
     571        my $meta_value = $2; 
     572        if ($meta_name =~ /\./) { 
     573        $meta_name = "ex.$meta_name"; 
     574        } 
     575        $doc_obj->set_utf8_metadata_element ($topsection, $meta_name, $meta_value); 
    568576        #$meta->{$1} = $2; 
    569577    } else {