The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

HTML::Index::Document - Perl object used by HTML::Index::Store to create an index of HTML documents for searching

SYNOPSIS

    $doc = HTML::Index::Document->new( path => $path );

    $doc = HTML::Index::Document->new( 
        name        => $name,
        contents    => $contents,
        mod_time    => $mod_time,
    );

DESCRIPTION

This module allows you to create objects to represent HTML documents to be indexed for searching using the HTML::Index modules. These might be HTML files in a webserver document root, or HTML pages stored in a database, etc.

HTML::Index::Document is a subclass of Class::Struct, with 4 attributes:

path

The path to the document. This is an optional attribute, but if used should correspond to an existing, readable file.

name

The name of the document. This attribute is what is returned as a result of a search, and is the primary identifier for the document. It should be unique. If the path attribute is set, then the name attribute defaults to path. Otherwise, it must be provided to the constructor.

contents

The (HTML) contents of the document. This attribute provides the text which is indexed by HTML::Index::Store. If the path attribute is set, the contents attribute defaults to the contents of path. Otherwise, it must be provided to the constructor.

parser

Should be one of html or regex. If html, documents are parsed using HTML::TreeBuilder to extract visible text. If regex, the same job is done by a "quick and dirty" regex.

SEE ALSO

HTML::Index
HTML::Index::Store

AUTHOR

Ave Wrigley <ave.wrigley@gmail.com>

COPYRIGHT

Copyright (c) 2001 Ave Wrigley. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.