XML::SAX::IncrementalBuilder::LibXML - create DOM fragments from SAX events
my $builder = XML::SAX::IncrementalBuilder::LibXML->new; my $parser = XML::LibXML->new(Handler => $builder); $parser->parse( ... ); while (my $frag = $builder->get_node) { # do stuff }
This module builds on XML::LibXML::SAX::Builder to build DOM fragments from SAX events. Instead of (or in addition to) creating a complete DOM tree, it splits up the document into chunks based on the depth they are in the tree.
Creates a new object. Accepts the following parameters
Lets you specify up to how deep in the xml tree you want to have the elements reported. A value of 2 would report the root element, and all of its children and grandchildren. The default value for this is 1
Whether to detach the elements at godepth from their parent. This is useful if you have a very large document to parse, and don't want to keep it all in memory. For example if POE::Filter::SAXBuilder is used in a jabber application, which generates a potentially endless stream of xml.
creates a new instance of the Builder with the same settings.
Returns a single node from the list of nodes that have finished building.
Returns the number of nodes that have been completely built.
Set the Builder back to its start state
You easily get segfaults if you use xpath on nodes that aren't in a document. This is a problem in XML::LibXML. Until the problem is fixed, make sure you put anything you want to run xpath on inside an XML::LibXML::Document first.
XML::Filter::DOMFilter::LibXML has similar functionality, but based on xpath expressions.
Martijn van Beers <martijn@cpan.org>
POE::Loop::Glib is released under the GPL version 2.0 or higher. See the file LICENCE for details.
To install XML::SAX::IncrementalBuilder::LibXML, copy and paste the appropriate command in to your terminal.
cpanm
cpanm XML::SAX::IncrementalBuilder::LibXML
CPAN shell
perl -MCPAN -e shell install XML::SAX::IncrementalBuilder::LibXML
For more information on module installation, please visit the detailed CPAN module installation guide.