Perlsax handler that creates xml::dom document structures
use XML::Handler::BuildDOM; use XML::Parser::PerlSAX;
my $handler = new XML::Handler::BuildDOM (KeepCDATA => 1); my $parser = new XML::Parser::PerlSAX (Handler => $handler);
my $doc = $parser->parsefile ("file.xml");
XML::Handler::BuildDOM creates \s-1XML::DOM\s0 document structures (i.e. XML::DOM::Document) from PerlSAX events.
This class used to be called XML::PerlSAX::DOM prior to libxml-enno 1.0.1.
\$1
The XML::Handler::BuildDOM constructor supports the following options:
If set to 0 (default), CDATASections will be converted to regular text. If undefined, start_document will extract it from Element or DocType (if set), otherwise it will create a new XML::DOM::Document. If undefined, it is set to Document. This will be the insertion point (or parent) for the nodes defined by the following callbacks. If undefined, start_document will extract it from Document (if possible). Otherwise it adds a new XML::DOM::DocumentType to the Document.