NAME

HTML::TreeBuilder::toSAX - SAX export of HTML::TreeBuilder trees

SYNOPSIS

  use HTML::TreeBuilder::toSAX;
  
  my $tree= HTML::TreeBuilder::toSAX->new();
  $tree->parse_file( 'example.html');

  # write using a SAX1 writer
  use XML::Handler::YAWriter;
  my $writer1 = XML::Handler::YAWriter->new( AsFile => '-', Pretty => $pretty);
  $tree->toSAX1( $writer1);
  
  # write using a SAX2 writer
  use XML::SAX::Writer;
  my $writer2 = XML::SAX::Writer->new( );
  $tree->toSAX2( $writer2);

  

DESCRIPTION

HTML::TreeBuilder::toSAX is a subclass of HTML::TreeBuilder that allows SAX export for a tree.

The tree itself is subclassed as an HTML::TreeBuilder::toSAX object, and its elements are subclassed as HTML::Element::toSAX instead of the normal HTML::Element

METHODS

toSAX1

SAX1 export of a tree

toSAX2

SAX2 export of a tree

BUGS, CAVEATS, TODO

SEE ALSO

HTML::TreeBuilder

Perl SAX

AUTHOR

Michel Rodriguez, <mirod@cpan.org>

COPYRIGHT AND LICENSE

Copyright (C) 2004 by Michel Rodriguez

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.4 or, at your option, any later version of Perl 5 you may have available.