The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

    XML::Essex::Event - ...

SYNOPSIS

DESCRIPTION

The base event class, also used for unknown event types. Stringifies as $event->type . "()" to indicate an event that has no natural way to represented in XML, or for ones that haven't been handled yet in Essex.

Methods

new
    XML::Event->new( a => 1, b => 2 );
    XML::Event->new( { a => 1, b => 2 } );
    
    ## in a subclass:
    sub new {
        my $self = shift->SUPER::new( @_ );
        ...
        return $self;
    }

A generic constructor.

If a single value is passed in, a reference to it is kept. This must be a HASH for all builtin objects.

If an even number of parameters is passed in, treats them as key => value pairs and creates a HASH around them.

isa

Accepts shorthand; if the object's class starts with "XML::Essex::Event::", the parameter is checked against the string after "XML::Essex::Event::". So a XML::Essex::Event::foo->isa( "foo" ) is true (assuming it really is true; in other words, assuming that its @ISA is set properly).

clone
    my $clone = $e->clone;

Does a deep copy of an event. Any events that require a deep copy must overload this to provide it, the default action is to just copy the main HASH.

type

Strips all characters up to the "::" and returns the remainder, so, for the XML::Essex::start_document class, this returns "start_document".

This must return a valid SAX event name, it is used to figure out how to serialize most event objects.

This is overloaded in most classes for speed and to allow subclasses to tweak the behavior of a class and still be reported as the proper type.

generate_SAX
    $e->generate_SAX( $handler );

Emits the SAX event(s) necessary to serialize this event object and send them to $handler. $handler will always be defined.

Uses the type method to figure out what to send. Some classes (notably XML::Essex::characters) overload this for various reasons.

Assumes scalar context (which should not cause problems).

LIMITATIONS

COPYRIGHT

    Copyright 2002, R. Barrie Slaymaker, Jr., All Rights Reserved

LICENSE

You may use this module under the terms of the BSD, Artistic, oir GPL licenses, any version.

AUTHOR

Barrie Slaymaker <barries@slaysys.com>