Changeset 10170


Ignore:
Timestamp:
2005-06-24T14:11:00+12:00 (19 years ago)
Author:
kjdon
Message:

made our, added two parse methods - if you want to do xml parsing from a subclass, can't call the parser directly

File:
1 edited

Legend:

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

    r9957 r10170  
    5555
    5656
    57 my ($self);
     57our ($self);
    5858sub new {
    5959    my $class = shift (@_);
     
    204204    # we'll just continue quietly
    205205
    206     ## print STDERR "**** Error is: $@\n";
     206    print STDERR "**** Error is: $@\n";
    207207
    208208    my ($msg) = $@ =~ /Carp::croak\(\'(.*?)\'\)/;
     
    220220
    221221    return 1; # processed the file
     222}
     223
     224# the following two methods are for if you want to do the parsing from a
     225# plugin that inherits from this. it seems that you can't call the parse
     226# methods directly. WHY???
     227sub parse_file {
     228    $self = shift (@_);
     229    my ($filename) = @_;
     230    $self->{'parser'}->parsefile($filename);
     231}
     232
     233sub parse_string {
     234    $self = shift (@_);
     235    my ($xml_string) = @_;
     236    $self->{'parser'}->parse($xml_string);
    222237}
    223238
Note: See TracChangeset for help on using the changeset viewer.