package XML::SAX::ExpatXS::Preload;

#-----------------------------------------------------#
# STOP!!!!!
#
# This file is generated by the 'Makefile.PL' file
# that ships with the XML::SAX::ExpatXS distribution.
# If you need to make changes, patch that file NOT
# this one.
#-----------------------------------------------------#

use strict;
use vars qw($VERSION);

$VERSION = '0.01';

sub get_end_element {
    my $self = shift;

    my $method;
    my $callbacks;
    if (exists $self->{ParseOptions}) {
        $callbacks = $self->{ParseOptions};
    }
    else {
        $callbacks = $self;
    }

    if (0) { # dummy to make elsif's below compile
    }
    elsif (defined $callbacks->{'ContentHandler'} and $method = $callbacks->{'ContentHandler'}->can('end_element') ) {
        my $handler = $callbacks->{'ContentHandler'};
        $self->{Methods}->{'end_element'} = sub { $method->($handler, @_) };
    }
    elsif (defined $callbacks->{'DocumentHandler'} and $method = $callbacks->{'DocumentHandler'}->can('end_element') ) {
        my $handler = $callbacks->{'DocumentHandler'};
        $self->{Methods}->{'end_element'} = sub { $method->($handler, @_) };
    }
    elsif (defined $callbacks->{'Handler'} and $method = $callbacks->{'Handler'}->can('end_element') ) {
        my $handler = $callbacks->{'Handler'};
        $self->{Methods}->{'end_element'} = sub { $method->($handler, @_) };
    }
    elsif (defined $callbacks->{'ContentHandler'} and $callbacks->{'ContentHandler'}->can('AUTOLOAD') ) {
        my $res = eval { $callbacks->{'ContentHandler'}->end_element(@_) };
        if ($@) {
            die $@;
        }
        else {
            my $handler = $callbacks->{'ContentHandler'};
            $self->{Methods}->{'end_element'} = sub { $handler->end_element(@_) };
        }
    }
    elsif (defined $callbacks->{'DocumentHandler'} and $callbacks->{'DocumentHandler'}->can('AUTOLOAD') ) {
        my $res = eval { $callbacks->{'DocumentHandler'}->end_element(@_) };
        if ($@) {
            die $@;
        }
        else {
            my $handler = $callbacks->{'DocumentHandler'};
            $self->{Methods}->{'end_element'} = sub { $handler->end_element(@_) };
        }
    }
    elsif (defined $callbacks->{'Handler'} and $callbacks->{'Handler'}->can('AUTOLOAD') ) {
        my $res = eval { $callbacks->{'Handler'}->end_element(@_) };
        if ($@) {
            die $@;
        }
        else {
            my $handler = $callbacks->{'Handler'};
            $self->{Methods}->{'end_element'} = sub { $handler->end_element(@_) };
        }
    }
    else {
        $self->{Methods}->{'end_element'} = sub { };
    }

return 1;
}

sub get_comment {
    my $self = shift;

    my $method;
    my $callbacks;
    if (exists $self->{ParseOptions}) {
        $callbacks = $self->{ParseOptions};
    }
    else {
        $callbacks = $self;
    }

    if (0) { # dummy to make elsif's below compile
    }
    elsif (defined $callbacks->{'DocumentHandler'} and $method = $callbacks->{'DocumentHandler'}->can('comment') ) {
        my $handler = $callbacks->{'DocumentHandler'};
        $self->{Methods}->{'comment'} = sub { $method->($handler, @_) };
    }
    elsif (defined $callbacks->{'LexicalHandler'} and $method = $callbacks->{'LexicalHandler'}->can('comment') ) {
        my $handler = $callbacks->{'LexicalHandler'};
        $self->{Methods}->{'comment'} = sub { $method->($handler, @_) };
    }
    elsif (defined $callbacks->{'Handler'} and $method = $callbacks->{'Handler'}->can('comment') ) {
        my $handler = $callbacks->{'Handler'};
        $self->{Methods}->{'comment'} = sub { $method->($handler, @_) };
    }
    elsif (defined $callbacks->{'DocumentHandler'} and $callbacks->{'DocumentHandler'}->can('AUTOLOAD') ) {
        my $res = eval { $callbacks->{'DocumentHandler'}->comment(@_) };
        if ($@) {
            die $@;
        }
        else {
            my $handler = $callbacks->{'DocumentHandler'};
            $self->{Methods}->{'comment'} = sub { $handler->comment(@_) };
        }
    }
    elsif (defined $callbacks->{'LexicalHandler'} and $callbacks->{'LexicalHandler'}->can('AUTOLOAD') ) {
        my $res = eval { $callbacks->{'LexicalHandler'}->comment(@_) };
        if ($@) {
            die $@;
        }
        else {
            my $handler = $callbacks->{'LexicalHandler'};
            $self->{Methods}->{'comment'} = sub { $handler->comment(@_) };
        }
    }
    elsif (defined $callbacks->{'Handler'} and $callbacks->{'Handler'}->can('AUTOLOAD') ) {
        my $res = eval { $callbacks->{'Handler'}->comment(@_) };
        if ($@) {
            die $@;
        }
        else {
            my $handler = $callbacks->{'Handler'};
            $self->{Methods}->{'comment'} = sub { $handler->comment(@_) };
        }
    }
    else {
        $self->{Methods}->{'comment'} = sub { };
    }

return 1;
}

sub get_characters {
    my $self = shift;

    my $method;
    my $callbacks;
    if (exists $self->{ParseOptions}) {
        $callbacks = $self->{ParseOptions};
    }
    else {
        $callbacks = $self;
    }

    if (0) { # dummy to make elsif's below compile
    }
    elsif (defined $callbacks->{'ContentHandler'} and $method = $callbacks->{'ContentHandler'}->can('characters') ) {
        my $handler = $callbacks->{'ContentHandler'};
        $self->{Methods}->{'characters'} = sub { $method->($handler, @_) };
    }
    elsif (defined $callbacks->{'DocumentHandler'} and $method = $callbacks->{'DocumentHandler'}->can('characters') ) {
        my $handler = $callbacks->{'DocumentHandler'};
        $self->{Methods}->{'characters'} = sub { $method->($handler, @_) };
    }
    elsif (defined $callbacks->{'Handler'} and $method = $callbacks->{'Handler'}->can('characters') ) {
        my $handler = $callbacks->{'Handler'};
        $self->{Methods}->{'characters'} = sub { $method->($handler, @_) };
    }
    elsif (defined $callbacks->{'ContentHandler'} and $callbacks->{'ContentHandler'}->can('AUTOLOAD') ) {
        my $res = eval { $callbacks->{'ContentHandler'}->characters(@_) };
        if ($@) {
            die $@;
        }
        else {
            my $handler = $callbacks->{'ContentHandler'};
            $self->{Methods}->{'characters'} = sub { $handler->characters(@_) };
        }
    }
    elsif (defined $callbacks->{'DocumentHandler'} and $callbacks->{'DocumentHandler'}->can('AUTOLOAD') ) {
        my $res = eval { $callbacks->{'DocumentHandler'}->characters(@_) };
        if ($@) {
            die $@;
        }
        else {
            my $handler = $callbacks->{'DocumentHandler'};
            $self->{Methods}->{'characters'} = sub { $handler->characters(@_) };
        }
    }
    elsif (defined $callbacks->{'Handler'} and $callbacks->{'Handler'}->can('AUTOLOAD') ) {
        my $res = eval { $callbacks->{'Handler'}->characters(@_) };
        if ($@) {
            die $@;
        }
        else {
            my $handler = $callbacks->{'Handler'};
            $self->{Methods}->{'characters'} = sub { $handler->characters(@_) };
        }
    }
    else {
        $self->{Methods}->{'characters'} = sub { };
    }

return 1;
}

sub get_start_element {
    my $self = shift;

    my $method;
    my $callbacks;
    if (exists $self->{ParseOptions}) {
        $callbacks = $self->{ParseOptions};
    }
    else {
        $callbacks = $self;
    }

    if (0) { # dummy to make elsif's below compile
    }
    elsif (defined $callbacks->{'ContentHandler'} and $method = $callbacks->{'ContentHandler'}->can('start_element') ) {
        my $handler = $callbacks->{'ContentHandler'};
        $self->{Methods}->{'start_element'} = sub { $method->($handler, @_) };
    }
    elsif (defined $callbacks->{'DocumentHandler'} and $method = $callbacks->{'DocumentHandler'}->can('start_element') ) {
        my $handler = $callbacks->{'DocumentHandler'};
        $self->{Methods}->{'start_element'} = sub { $method->($handler, @_) };
    }
    elsif (defined $callbacks->{'Handler'} and $method = $callbacks->{'Handler'}->can('start_element') ) {
        my $handler = $callbacks->{'Handler'};
        $self->{Methods}->{'start_element'} = sub { $method->($handler, @_) };
    }
    elsif (defined $callbacks->{'ContentHandler'} and $callbacks->{'ContentHandler'}->can('AUTOLOAD') ) {
        my $res = eval { $callbacks->{'ContentHandler'}->start_element(@_) };
        if ($@) {
            die $@;
        }
        else {
            my $handler = $callbacks->{'ContentHandler'};
            $self->{Methods}->{'start_element'} = sub { $handler->start_element(@_) };
        }
    }
    elsif (defined $callbacks->{'DocumentHandler'} and $callbacks->{'DocumentHandler'}->can('AUTOLOAD') ) {
        my $res = eval { $callbacks->{'DocumentHandler'}->start_element(@_) };
        if ($@) {
            die $@;
        }
        else {
            my $handler = $callbacks->{'DocumentHandler'};
            $self->{Methods}->{'start_element'} = sub { $handler->start_element(@_) };
        }
    }
    elsif (defined $callbacks->{'Handler'} and $callbacks->{'Handler'}->can('AUTOLOAD') ) {
        my $res = eval { $callbacks->{'Handler'}->start_element(@_) };
        if ($@) {
            die $@;
        }
        else {
            my $handler = $callbacks->{'Handler'};
            $self->{Methods}->{'start_element'} = sub { $handler->start_element(@_) };
        }
    }
    else {
        $self->{Methods}->{'start_element'} = sub { };
    }

return 1;
}


1;

__END__

=head1 NAME

XML::SAX::ExpatXS::Preload - Helper class for XML-SAX-ExpatXS

=head1 AUTHOR

Petr Cimprich (petr@gingerall.cz) based on an original code of XML::SAX::Base 
by Kip Hampton (khampton@totalcinema.com).

=head1 SEE ALSO

L<XML::SAX::ExpatXS>

=cut

