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

NAME

Test::XHTML::Valid - test web page DTD validation.

SYNOPSIS

    my $txv = Test::XHTML::Valid->new();

    $txv->ignore_list(@IGNORE);             # patterns to ignore

    # dynamic pages
    $txv->process_root($opt{url});          # test all pages beneath root
    $txv->process_link($opt{link});         # test single link
    $txv->process_url_list($opt{ulist});    # test list of links

    # static pages
    $txv->process_path($opt{path});         # test all files within path
    $txv->process_file($opt{file});         # test single file
    $txv->process_file_list($opt{flist});   # test list of files

    # XML strings
    $txv->process_xml($xml);                # test XML as a string

    $txv->process_retries();                # retest any network failures
    my $results = $txv->process_results();

    $txv->content();            # for further testing of single page content
    $txv->errors();             # all current errors reported
    $txv->clear();              # clear all current errors and results

    $txv->retrieve_url($url);   # retrieve URL, no testing required
    $txv->retrieve_file($file); # retrieve file, no testing required

    $txv->logfile($file);       # logfile for verbose messages
    $txv->logclean(1);          # 1 = create/overwrite, 0 = append (default)

DESCRIPTION

Using either URLs or flat files, this module attempts to validate web pages according to the DTD schema specified within each page.

METHODS

Constructor

Enables test object to retain content, results and errors as appropriate.

new()

Creates and returns a Test::XHTML::Valid object.

Public Methods

ignore_list(@LIST)

Patterns to ignore.

process_root(URL)

Test all pages beneath root URL.

process_link(URL)

Test a single link.

process_url_list(FILE)

Test list of links contained in FILE (one per line).

process_path(PATH)

Test all files within the local directory path.

process_file(FILE)

Test a single file.

process_file_list(FILE)

Test list of files contained in FILE (one per line).

process_xml(XML)

Test a single XML string, which is assumed to be a complete XHTML file.

process_retries()

Retest any network failures.

process_results()

Record results to log file (if given) and returns a hashref.

content()

Returns the single page content of the last processed page. Useful if required for further testing.

errors()

Returns all the current errors reported as XML::LibXML::Error objects.

errstr()

Returns all the current errors reported as a single string.

clear()

Clear all current errors and results.

retrieve_url(URL)

Retrieve URL, no testing required.

retrieve_file(FILE)

Retrieve FILE, no testing required.

logfile(FILE)

Set output log file for verbose messages.

logclean(STATE)

Set STATE to 1 (create/overwrite) or 0 (append - the default)

BUGS, PATCHES & FIXES

There are no known bugs at the time of this release. However, if you spot a bug or are experiencing difficulties, that is not explained within the POD documentation, please send bug reports and patches to barbie@cpan.org.

Fixes are dependent upon their severity and my availability. Should a fix not be forthcoming, please feel free to (politely) remind me.

SEE ALSO

XML::LibXML

AUTHOR

  Barbie, <barbie@cpan.org>
  for Miss Barbell Productions <http://www.missbarbell.co.uk>.

COPYRIGHT AND LICENSE

  Copyright (C) 2008-2013 Barbie for Miss Barbell Productions.

  This distribution is free software; you can redistribute it and/or
  modify it under the Artistic Licence v2.