HTML-HTML5-Parser
view release on metacpan or search on metacpan
A last note is to mention what gets returned by this method. Normally
it's an XML::LibXML::DocumentFragment object, but if you call the
method in list context, a list of the individual node elements is
returned. Alternatively you can request the data to be returned as an
XML::LibXML::NodeList object:
# Get an XML::LibXML::NodeList
my $list = $parser->parse_balanced_chunk($str, {as=>'list'});
The exact implementation of this method may change from version to
version, but the long-term goal will be to approach how common desktop
browsers parse HTML fragments when implementing the setter for DOM's
`innerHTML` attribute.
The push parser and SAX-based parser are not supported. Trying to change
an option (such as recover_silently) will make HTML::HTML5::Parser carp a
warning. (But you can inspect the options.)
Error Handling
Error handling is obviously different to XML::LibXML, as errors are (bugs
notwithstanding) non-fatal.
lib/HTML/HTML5/Parser.pm view on Meta::CPAN
it's an L<XML::LibXML::DocumentFragment> object, but if you call the
method in list context, a list of the individual node elements is
returned. Alternatively you can request the data to be returned as an
L<XML::LibXML::NodeList> object:
# Get an XML::LibXML::NodeList
my $list = $parser->parse_balanced_chunk($str, {as=>'list'});
The exact implementation of this method may change from version to
version, but the long-term goal will be to approach how common
desktop browsers parse HTML fragments when implementing the setter
for DOM's C<innerHTML> attribute.
=back
The push parser and SAX-based parser are not supported. Trying
to change an option (such as recover_silently) will make
HTML::HTML5::Parser carp a warning. (But you can inspect the
options.)
=head2 Error Handling
( run in 0.360 second using v1.01-cache-2.11-cpan-299005ec8e3 )