Changeset 17289


Ignore:
Timestamp:
2008-09-15T15:25:14+12:00 (16 years ago)
Author:
kjdon
Message:

moved the actual parsing from read into parse_file so other plugins can do parsing without calling read(). Note, still have testing to do for this, but am going home now

File:
1 edited

Legend:

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

    r17026 r17289  
    213213    $self->{'filename'} = $filename_full_path;
    214214    $self->{'processor'} = $processor;
     215    # this contains metadata passed in from running metadata_read with other plugins (eg from MetadataXMLPlugin)
     216    # we are also using it to store up any metadata found during parsing the XML, so that it can be added to the doc obj.
    215217    $self->{'metadata'} = $metadata;
    216218
     219    if ($self->parsefile($filename_full_path)) {
     220    return 1; # processed the file
     221    }
     222    return -1;
     223}
     224
     225
     226sub parse_file {
     227    my $self = shift (@_);
     228    my ($filename_full_path, $file, $gli) = @_;
    217229    eval {
    218230    my $xslt = $self->{'xslt'};
     
    252264    return -1; # error during processing
    253265    }
    254 
    255    
    256     return 1; # processed the file
    257 }
    258 
     266    return 1; # parsing was successful
     267}
    259268
    260269sub get_default_process_exp {
Note: See TracChangeset for help on using the changeset viewer.