views:

77

answers:

4

Where can I find some simple W3C Validator API info for Perl? I've tried looking and just keeps leading to page after page of documentation.

  1. Simply looking for download module or whatever is needed (I am new to Perl but I want to use it for this project)
  2. How to install it (Again, new to Perl)
  3. There was going to be a third about documentation but I've found loads!
A: 

This is on CPAN: WebService::Validator::Feed::W3C.

To install then read CPAN doc for full details. Quick synopsis (command line):

cpan WebService::Validator::Feed::W3C

/I3az/

draegtun
Downvote because the question was about document validation, not feed validation.
daxim
+1  A: 

The API is documented in the documentation for the Validator, but you don't really need to worry about it as there is a nice abstraction available on CPAN.

How you install it depends largely on where you got your install of Perl from. On UNIX based systems I would follow the bootstrap instructions for local::lib and then install with cpan WebService::Validator::HTML::W3C. On Windows, I'd use Strawberry Perl and then just go with their cpan program.

For performance and "being nice to the W3C's bandwidth bill", I'd install a local copy of the Validator (again, the specifics depend on the OS you are using).

David Dorward
Downvote because the question was about document validation, not feed validation.
daxim
Fixed. My search-fu failed me and I grabbed the wrong module from cpan.
David Dorward
+4  A: 

See W3C::LogValidator::HTMLValidator:

Batch HTML validation (using the W3C Markup Validator)

See also W3C for more information on related tools.

As for installation instructions, it would be good to know your platform. For starters, however, you can read perldoc perlmodinstall.

Keep in mind that using the platform specific package installer is preferable if you are adding modules to the system's Perl installation.

Sinan Ünür
+2  A: 

You want WebService::Validator::HTML::W3C, see the synopsis in its documentation for a taste of the API; I just tried it and it's very simple. W::V::H::W3C is a normal CPAN distribution, you install it the usual way. There are a number of SO questions about Perl module installation, read them if you encounter problems.

daxim