Ignore:
Timestamp:
2011-08-12T19:35:50+12:00 (13 years ago)
Author:
ak19
Message:

Changes to perl code to do with removing the ex. prefix: ex. is only removed if it is the sole prefix (i.e. ex.dc.* prefixes are not removed).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/doc.pm

    r23939 r24404  
    807807    }
    808808
    809     # Remove the namespace if we are being told to ignore them
     809    # Remove any namespace if we are being told to ignore them
    810810    if($ignore_namespace) {
    811     $field =~ s/^\w*\.//;
     811    $field =~ s/^.*\.//; #$field =~ s/^\w*\.//;
    812812    }
    813813
     
    816816    my $data_name = $data->[0];
    817817
    818     # Remove the any namespace if we are being told to ignore them
     818    # Remove any namespace if we are being told to ignore them
    819819    if($ignore_namespace) {
    820         $data_name =~ s/^\w*\.//;
    821     }
    822     $data_name =~ s/^ex\.//; # we always remove ex. - it maybe there in doc_obj, but we will never ask for it.
     820        $data_name =~ s/^.*\.//; #$data_name =~ s/^\w*\.//;
     821    }
     822    # we always remove ex. (but not any subsequent namespace) - ex. maybe there in doc_obj, but we will never ask for it.
     823    $data_name =~ s/^ex\.([^.]+)$/$1/; #$data_name =~ s/^ex\.//;
     824   
    823825    return $data->[1] if (scalar(@$data) >= 2 && $data_name eq $field);
    824826    }
     
    842844    }
    843845
    844     # Remove the any namespace if we are being told to ignore them
     846    # Remove any namespace if we are being told to ignore them
    845847    if($ignore_namespace) {
    846     $field =~ s/^\w*\.//;
     848    $field =~ s/^.*\.//;
    847849    }
    848850
     
    851853
    852854    my $data_name = $data->[0];
    853     # Remove the any namespace if we are being told to ignore them
     855
     856    # Remove any namespace if we are being told to ignore them
    854857    if($ignore_namespace) {
    855         $data_name =~ s/^\w*\.//;
    856     }
    857     $data_name =~ s/^ex\.//; # we always remove ex. - it maybe there in doc_obj, but we will never ask for it.
     858        $data_name =~ s/^.*\.//;
     859    }   
     860    # we always remove ex. (but not any subsequent namespace) - ex. maybe there in doc_obj, but we will never ask for it.
     861    $data_name =~ s/^ex\.([^.]+)$/$1/;
     862
    858863        push (@metadata, $data->[1]) if ($data_name eq $field);
    859864    }
Note: See TracChangeset for help on using the changeset viewer.