Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

html::html5::parser::error(3pm) [debian man page]

HTML::HTML5::Parser::Error(3pm) 			User Contributed Perl Documentation			   HTML::HTML5::Parser::Error(3pm)

NAME
HTML::HTML5::Parser::Error - an error that occured during parsing DESCRIPTION
Note that HTML::HTML5::Parser is not a validation tool, and there are many classes of error that it does not care about, so will not raise. The "error_handler" and "errors" methods of "HTML::HTML5::Parser" generate "HTML::HTML5::Parser::Error" objects. "HTML::HTML5::Parser::Error" overloads stringification, so can be printed, matched against regular expressions, etc. Constructor "new(level=>$level, type=>$type, token=>$token, ...)" Constructs a new "HTML::HTML5::Parser::Error" object. Methods "level" Returns the level of error. ('MUST', 'SHOULD', 'WARN', 'INFO' or undef.) "layer" Returns the parsing layer involved, often undef. e.g. 'encode'. "type" Returns the type of error as a string. "tag_name" Returns the tag name (if any). "source_line" ($line, $col) = $error->source_line(); $line = $error->source_line; In scalar context, "source_line" returns the line number of the source code that triggered the error. In list context, returns a line/column pair. (Tab characters count as one column, not eight.) "to_string" Returns a friendly error string. SEE ALSO
HTML::HTML5::Parser. AUTHOR
Toby Inkster, <tobyink@cpan.org> COPYRIGHT AND LICENSE
Copyright (C) 2011-2012 by Toby Inkster 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.1 or, at your option, any later version of Perl 5 you may have available. perl v5.14.2 2012-03-19 HTML::HTML5::Parser::Error(3pm)

Check Out this Related Man Page

HTML::HTML5::Sanity(3pm)				User Contributed Perl Documentation				  HTML::HTML5::Sanity(3pm)

NAME
HTML::HTML5::Sanity - make HTML5 DOM trees less insane SYNOPSIS
use HTML::HTML5::Parser; use HTML::HTML5::Sanity; my $parser = HTML::HTML5::Parser->new; my $html5_dom = $parser->parse_file('http://example.com/'); my $sane_dom = fix_document($html5_dom); DESCRIPTION
The Document Object Model (DOM) generated by HTML::HTML5::Parser meets the requirements of the HTML5 spec, but will probably catch a lot of people by surprise. The main oddity is that elements and attributes which appear to be namespaced are not really. For example, the following element: <div xml:lang="fr">...</div> Looks like it should be parsed so that it has an attribute "lang" in the XML namespace. Not so. It will really be parsed as having the attribute "xml:lang" in the null namespace. "fix_document($document)" $sane_dom = fix_document($html5_dom); Returns a modified copy of the DOM and leaving the original DOM unmodified. "fix_element($element_node, $new_document_node, \%namespaces)" Don't use this. Not exported. "fix_attribute($attribute_node, $new_element_node, \%namespaces)" Don't use this. Not exported. $HTML::HTML5::Sanity::FIX_LANG_ATTRIBUTES $HTML::HTML5::Sanity::FIX_LANG_ATTRIBUTES = 2; $sane_dom = fix_document($html5_dom); If set to 1 (the default), the package will detect invalid values in @lang and @xml:lang, and remove the attribute if it is invalid. If set to 2, it will also attempt to canonicalise the value (e.g. 'EN_GB' will be converted to to 'en-GB'). If set to 0, then the value of language attributes is not checked. BUGS
Please report any bugs to <http://rt.cpan.org/>. SEE ALSO
HTML::HTML5::Parser, XML::LibXML, Task::HTML5. AUTHOR
Toby Inkster <tobyink@cpan.org>. COPYRIGHT AND LICENSE
Copyright (C) 2009-2011 by Toby Inkster This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2011-12-08 HTML::HTML5::Sanity(3pm)
Man Page