
use strict ;


package MyTest ;

use vars qw( @ISA ) ;

use XML::Parser::Notifier::SimpleDispatcher ;
@ISA = ( qw/XML::Parser::Notifier::SimpleDispatcher/ ) ;

use XML::Serial::Encoder ;
use SGML::Generic::Printer ;
use SGML::Generic::Output ;

sub Init {
    my ($self, $xp, $notifier) = @_ ;
    my $ser = new XML::Serial::Encoder ;
    my ($desc) = $ser -> request( 'expat', $xp ) ;
    push_output( 'string', qq[<?xml version="1.0"?>\n] ) ;
    SGML::Generic::Printer -> new( WellFormed => 1 ) -> print( $desc ) ;
    print pop_output ;
    $notifier -> remove_client( $self ) ;
}

package main ;

use XML::Parser::Notifier ;
my $notifier = new XML::Parser::Notifier ;
$notifier -> add_client( new MyTest ) ;
$notifier -> parse( '<foo>bar</foo>' ) ;

