Exactly one of uri, file or string must be given.
Validation is then (unless jar is given) performed using the
new W3C Markup Validation service at the given URL,
as appropriate for programmatic checking of modern HTML (i.e., HTML5)
documents. See https://validator.w3.org/docs/api.html for more
information.
(Versions of W3CMarkupValidator up to 0.1-7 used the obsolete
SOAP 1.2 API for the Markup Validator, which cannot handle HTML5.)
If the validation requests was successful (i.e., a 200 OK response
status was returned), w3c_markup_validate() returns the
information in the response organized into an object of class
"w3c_markup_validate", which is a data frame with with rows
giving the diagnostic messages and the following variables:
type
a character string giving the type of the
message: one of "info", "error" or
"document-error".
subType
a character string giving the subtype of the
message. For type "info" this can be "warning" or
missing; for type "error" this can be "fatal" or
missing.
firstLine, firstColumn, lastLine,
lastColumn
integers indicating the range of source code
associated with the message.
message
a character string giving the diagnostic
message text.
extract
a character string representing an extract of
the document source from around the point in source designated for
the message by the line and column numbers.
Alternatively, one can also use the underling Nu HTML checker directly
(via invoking the Java interpreter) using a local vnu.jar JAR
file by giving the path to this file in the jar argument.
See https://validator.github.io/validator/ for more information.
Using the latest version of vnu.jar from
https://github.com/validator/validator/releases/tag/latest works
best. Installing package vnu.jar from the repository at
https://datacube.wu.ac.at conveniently provides the JAR file,
see the examples. Using jar = TRUE will use that JAR file.
This class has methods for print for compactly
summarizing the results, and an inspect method for
inspecting details.