Tree::Simple::SAX::Handler - An XML::SAX Handler to create Tree::Simple objects from XML
use Tree::Simple::SAX; use XML::SAX::ParserFactory; my $handler = Tree::Simple::SAX::Handler->new(Tree::Simple->new()); my $p = XML::SAX::ParserFactory->parser(Handler => $handler); $p->parse_string('<xml><string>Hello <world/>!</string></xml>'); # this will create a tree like this: # { tag_type => 'xml' } # { tag_type => 'string' } # { content => 'Hello ', tag_type => 'CDATA' } # { tag_type => 'world' } # { content => '!', tag_type => 'CDATA' }
This is a proof-of-concept XML::SAX handler which can build Tree::Simple hierarchies. See the Tree::Simple::SAX for more information.
I only support the basic start_element, end_element and character. I need to add more hooks to handle more sophisticated XML documents.
start_element
end_element
character
None that I am aware of. Of course, if you find a bug, let me know, and I will be sure to fix it.
I use Devel::Cover to test the code coverage of my tests, see the CODE COVERAGE section of Tree::Simple::SAX for more details.
CODE COVERAGE
stevan little, <stevan@iinteractive.com>
Copyright 2005 by Infinity Interactive, Inc.
http://www.iinteractive.com
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Tree::Simple::SAX, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Tree::Simple::SAX
CPAN shell
perl -MCPAN -e shell install Tree::Simple::SAX
For more information on module installation, please visit the detailed CPAN module installation guide.