Ignore:
Timestamp:
2010-07-05T15:01:12+12:00 (14 years ago)
Author:
kjdon
Message:

store any extracted metadata that has a namespace as ex.ns.meta

File:
1 edited

Legend:

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

    r22330 r22348  
    442442            unless $dont_strip && ($dont_strip eq 'all' || $metaname =~ m/^($dont_strip)$/);
    443443            $metavalue =~ s/\s+/ /sg;
     444            if ($metaname =~ /\./) { # has a namespace
     445            $metaname = "ex.$metaname";
     446            }
    444447            if ($accumulate) {
    445448            $doc_obj->add_utf8_metadata($cursection, $metaname, $metavalue);
     
    938941    # if we don't want metadata, we may as well not be here ...
    939942    return if (!defined $self->{'metadata_fields'});
    940 
     943   
    941944    my $separator = $self->{'metadata_field_separator'};
    942945    if ($separator eq "") {
     
    954957        $field =~ s/^\s+//; # remove leading whitespace
    955958        $field =~ s/\s+$//; # remove trailing whitespace
    956 
     959   
    957960    # support tag<tagname>
    958961    if ($field =~ m/^(.*?)\s*<(.*?)>$/) {
     
    10301033        next;
    10311034    }
    1032 
     1035   
    10331036    # clean up and add
    10341037    $value =~ s/\s+/ /gs;
     
    10511054    }
    10521055
    1053     # Do we still reply on the following?  Surely there must
    1054     # be a better way to go about this outside of the plugin?
    1055     #
    1056     #if ($tag =~ m/date.*/i){
    1057     #    $tag = lc($tag);
    1058     #}
     1056    if ($tag =~ /\./) {
     1057        # there is a . so has a namespace, add ex.
     1058        $tag = "ex.$tag";
     1059    }
    10591060    if (defined $separator) {
    10601061        my @values = split($separator, $value);
Note: See TracChangeset for help on using the changeset viewer.