NAME

HTML::Linear - represent HTML::Tree as a flat list

VERSION

version 0.019

SYNOPSIS

use Data::Printer;
use HTML::Linear;

my $hl = HTML::Linear->new;
$hl->parse_file(q(index.html));

for my $el ($hl->as_list) {
    my $hash = $el->as_hash;
    p $hash;
}

ATTRIBUTES

_list

Internal list representation.

_shrink

Internal shrink mode flag.

_strict

Internal strict mode flag.

_uniq

Used for internal collision detection.

_path_count

Used internally for computing numeric tag indexes (like in /p[3]).

METHODS

as_list

Access list as array.

count_elements

Number of elements in list.

get_element

Element accessor.

set_shrink

Enable XPath shrinking.

unset_shrink

Disable XPath shrinking.

set_strict

Do not group by id, class or name attributes.

unset_strict

Group by id, class or name attributes.

eof

Overrides HTML::TreeBuilder eof.

add_element

Add an element to the list.

deparse($node, $path)

Recursively scan underlying HTML::TreeBuilder structure.

AUTHOR

Stanislaw Pusep <stas@sysd.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2014 by Stanislaw Pusep.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.