Coder Social home page Coder Social logo

validator / validator Goto Github PK

View Code? Open in Web Editor NEW
1.6K 66.0 261.0 24.17 MB

Nu Html Checker – Helps you catch problems in your HTML/CSS/SVG

Home Page: https://validator.github.io/validator/

License: MIT License

Python 4.28% Shell 0.01% Java 88.60% Makefile 0.09% HTML 4.08% JavaScript 2.04% CSS 0.85% Dockerfile 0.05%
linter web-standards whatwg w3c web-development devtools style-linter html-linter html-checker html-validation

validator's Introduction

The Nu Html Checker (v.Nu) Chat room Download latest

The Nu Html Checker (v.Nu) helps you catch unintended mistakes in your HTML, CSS, and SVG. It enables you to batch-check documents from the command line and from other scripts/apps, and to deploy your own instance of the checker as a service (like validator.w3.org/nu). Its source code is available, as are instructions on how to build, test, and run the code.

A Dockerfile (see Pulling the Docker image below) and npm, pip, and brew packages are also available.

It is released upstream in these formats:

Note: The vnu.jar and vnu.war files require you to have Java 8 or above installed. The pre-compiled Linux, Windows, and macOS binaries don’t require you to have any version of Java already installed at all.

You can get the latest release or run docker run -it --rm -p 8888:8888 ghcr.io/validator/validator:latest, npm install vnu-jar, npm install --registry=https://npm.pkg.github.com @validator/vnu-jar, brew install vnu, or pip install html5validator and see the Usage and Web-based checking sections below. Or automate your document checking with a frontend such as:

Usage

Run the checker with one of the following invocations:

vnu-runtime-image/bin/vnu OPTIONS FILES (Linux or macOS)

vnu-runtime-image\bin\vnu.bat OPTIONS FILES (Windows)

java -jar ~/vnu.jar OPTIONS FILES (any system with Java8+ installed)

…where FILES are the documents to check, and OPTIONS are zero or more of the following options:

--errors-only --Werror --exit-zero-always --stdout --asciiquotes
--user-agent USER_AGENT --no-langdetect --no-stream --filterfile FILENAME
--filterpattern PATTERN --css --skip-non-css --also-check-css --svg
--skip-non-svg --also-check-svg --xml --html --skip-non-html
--format gnu|xml|json|text --help --verbose --version

The Options section below provides details on each option, and the rest of this section provides some specific examples.

Note: Throughout these examples, replace ~/vnu.jar with the actual path to that jar file on your system, and replace vnu-runtime-image/bin/vnu and vnu-runtime-image\bin\vnu.bat with the actual path to the vnu or vnu.bat program on your system — or if you add the vnu-runtime-image/bin or vnu-runtime-image\bin directory your system PATH environment variable, you can invoke the checker with just vnu.

To check one or more documents from the command line:

  vnu-runtime-image/bin/vnu      FILE.html FILE2.html FILE3.html...

  vnu-runtime-image\bin\vnu.bat  FILE.html FILE2.html FILE3.html...

  java -jar ~/vnu.jar            FILE.html FILE2.html FILE3.html...

Note: If you get a StackOverflowError error when invoking the checker, try adjusting the thread stack size by providing the -Xss option to java:

  java -Xss512k -jar ~/vnu.jar ...

  vnu-runtime-image/bin/java -Xss512k \
      -m vnu/nu.validator.client.SimpleCommandLineValidator ...

To check all documents in a particular directory DIRECTORY_PATH as HTML:

  java -jar ~/vnu.jar            DIRECTORY_PATH

  vnu-runtime-image/bin/vnu      DIRECTORY_PATH

  vnu-runtime-image\bin\vnu.bat  DIRECTORY_PATH

More examples

Note: The examples in this section assume you have the vnu-runtime-image/bin or vnu-runtime-image\bin directory in your system PATH environment variable. If you’re using the jar file instead, replace vnu in the examples with java -jar ~/vnu.jar.

To check all documents in a particular directory DIRECTORY_PATH as HTML, but skip any documents whose names don’t end with the extensions .html, .htm, .xhtml, or .xht:

  vnu --skip-non-html DIRECTORY_PATH

To check all documents in a particular directory as CSS:

  vnu --css DIRECTORY_PATH

To check all documents in a particular directory as CSS, but skip any documents whose names don’t end with the extension .css:

  vnu --skip-non-css DIRECTORY_PATH

To check all documents in a particular directory, with documents whose names end in the extension .css being checked as CSS, and all other documents being checked as HTML:

  vnu --also-check-css DIRECTORY_PATH

To check all documents in a particular directory as SVG:

  vnu --svg DIRECTORY_PATH

To check all documents in a particular directory as SVG, but skip any documents whose names don’t end with the extension .svg:

  vnu --skip-non-svg DIRECTORY_PATH

To check all documents in a particular directory, with documents whose names end in the extension .svg being checked as SVG, and all other documents being checked as HTML:

  vnu --also-check-svg DIRECTORY_PATH

To check a Web document:

  vnu _URL_

  example: vnu http://example.com/foo

To check standard input:

  vnu -

  example:

  echo '<!doctype html><title>...' | vnu -

  echo '<!doctype html><title>...' | java -jar ~/vnu.jar -

Options

When used from the command line as described in this section, the checker provides the following options:

--asciiquotes

Specifies whether ASCII quotation marks are substituted for Unicode smart
quotation marks in messages.

default: [unset; Unicode smart quotation marks are used in messages]

--errors-only

Specifies that only error-level messages and non-document-error messages are
reported (so that warnings and info messages are not reported).

default: [unset; all messages reported, including warnings & info messages]

--Werror

Makes the checker exit non-zero if any warnings are encountered (even if
there are no errors).

default: [unset; checker exits zero if only warnings are encountered]

--exit-zero-always

Makes the checker exit zero even if errors are reported for any documents.

default: [unset; checker exits 1 if errors are reported for any documents]

--stdout

Makes the checker report errors and warnings to stdout rather than stderr.

default: [unset; checker reports errors and warnings to stderr]

--filterfile FILENAME

Specifies a filename. Each line of the file contains either a regular
expression or starts with "#" to indicate the line is a comment. Any error
message or warning message that matches a regular expression in the file is
filtered out (dropped/suppressed).

default: [unset; checker does no message filtering]

--filterpattern REGEXP

Specifies a regular expression. Any error message or warning message that
matches the regular expression is filtered out (dropped/suppressed).

As with all other checker options, this option may only be specified once.
So to filter multiple error messages or warning messages, you must provide a
single regular expression that will match all the messages. The typical way
to do that for regular expressions is to OR multiple patterns together using
the "|" character.

default: [unset; checker does no message filtering]

--format format

Specifies the output format for reporting the results.

default: "gnu"

possible values: "gnu", "xml", "json", "text" [see information at URL below]

https://github.com/validator/validator/wiki/Service-%C2%BB-Common-params#out

--help

Shows detailed usage information.

--skip-non-css

Check documents as CSS but skip documents that don’t have *.css extensions.

default: [unset; all documents found are checked]

--css

Force all documents to be checked as CSS, regardless of extension.

default: [unset]

--skip-non-svg

Check documents as SVG but skip documents that don’t have *.svg extensions.

default: [unset; all documents found are checked]

--svg

Force all documents to be checked as SVG, regardless of extension.

default: [unset]

--skip-non-html

Skip documents that don’t have *.html, *.htm, *.xhtml, or *.xht extensions.

default: [unset; all documents found are checked, regardless of extension]

--html

Forces any *.xhtml or *.xht documents to be parsed using the HTML parser.

default: [unset; XML parser is used for *.xhtml and *.xht documents]

--xml

Forces any *.html documents to be parsed using the XML parser.

default: [unset; HTML parser is used for *.html documents]

--also-check-css

Check CSS documents (in addition to checking HTML documents).

default: [unset; no documents are checked as CSS]

--also-check-svg

Check SVG documents (in addition to checking HTML documents).

default: [unset; no documents are checked as SVG]

--user-agent USER_AGENT

Specifies the value of the User-Agent request header to send when checking
HTTPS/HTTP URLs.

default: "Validator.nu/LV"

--no-langdetect

Disables language detection, so that documents are not checked for missing
or mislabeled html[lang] attributes.

default: [unset; language detection & html[lang] checking are performed]

--no-stream

Forces all documents to be be parsed in buffered mode instead of streaming
mode (causes some parse errors to be treated as non-fatal document errors
instead of as fatal document errors).

default: [unset; non-streamable parse errors cause fatal document errors]

--verbose

Specifies "verbose" output. (Currently this just means that the names of
files being checked are written to stdout.)

default: [unset; output is not verbose]

--version

Shows the checker version number.

Web-based checking

The Nu Html Checker — along with being usable as a standalone command-line client — can be run as an HTTP service, similar to validator.w3.org/nu, for browser-based checking of HTML documents, CSS stylesheets, and SVG images over the Web. To that end, the checker is released as several separate packages:

  • Linux, Windows, and macOS binaries for deploying the checker as a simple self-contained service on any system

  • vnu.jar for deploying the checker as a simple self-contained service on a system with Java installed

  • vnu.war for deploying the checker to a servlet container such as Tomcat

All deployments expose a REST API that enables checking of HTML documents, CSS stylesheets, and SVG images from other clients, not just web browsers. And the Linux, Windows, and macOS binaries and vnu.jar package also include a simple HTTP client that enables you to either send documents to a locally-running instance of the checker HTTP service — for fast command-line checking — or to any remote instance of the checker HTTP service running anywhere on the Web.

The latest releases of the Linux, Windows, and macOS binaries and vnu.jar and vnu.war packages are available from the validator project at github. The following are detailed instructions on using them.

Note: Throughout these instructions, replace ~/vnu.jar with the actual path to that jar file on your system, and replace vnu-runtime-image/bin/java and vnu-runtime-image\bin\java.exe with the actual path to the checker java or java.exe program on your system — or if you add the vnu-runtime-image/bin or vnu-runtime-image\bin directory your system PATH environment variable, you can invoke the checker with just java nu.validator.servlet.Main 8888.

Standalone web server

To run the checker as a standalone service (using a built-in Jetty server), open a new terminal window and invoke the checker like this:

java -cp ~/vnu.jar              nu.validator.servlet.Main 8888

vnu-runtime-image/bin/java      nu.validator.servlet.Main 8888

vnu-runtime-image\bin\java.exe  nu.validator.servlet.Main 8888

Then open http://0.0.0.0:8888 in a browser. (To listen on a different port, replace 8888 with the port number.)

Warning: Future checker releases will bind by default to the address 127.0.0.1. Your checker deployment might become unreachable unless you use the nu.validator.servlet.bind-address system property to bind the checker to a different address:

java -cp ~/vnu.jar \
    -Dnu.validator.servlet.bind-address=128.30.52.73 \
    nu.validator.servlet.Main 8888

vnu-runtime-image/bin/java \
    -Dnu.validator.servlet.bind-address=128.30.52.73 \
    nu.validator.servlet.Main 8888

vnu-runtime-image\bin\java.exe  \
    -Dnu.validator.servlet.bind-address=128.30.52.73 \
    nu.validator.servlet.Main 8888

When you open http://0.0.0.0:8888 (or whatever URL corresponds to the nu.validator.servlet.bind-address value you’re using), you’ll see a form similar to validator.w3.org/nu that allows you to enter the URL of an HTML document, CSS stylesheet, or SVG image, and have the results of checking that resource displayed in the browser.

Note: If you get a StackOverflowError error when using the checker, try adjusting the thread stack size by providing the -Xss option to java:

  java -Xss512k -cp ~/vnu.jar nu.validator.servlet.Main 8888

  vnu-runtime-image/bin/java -Xss512k -m vnu/nu.validator.servlet.Main 8888

Deployment to servlet container

To run the checker inside of an existing servlet container such as Apache Tomcat you will need to deploy the vnu.war file to that server following its documentation. For example, on Apache Tomcat you could do this using the Manager application or simply by copying the file to the webapps directory (since that is the default appBase setting). Typically you would see a message similar to the following in the catalina.out log file.

May 7, 2014 4:42:04 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive /var/lib/tomcat7/webapps/vnu.war

Assuming your servlet container is configured to receive HTTP requests sent to localhost on port 80 and the context root of this application is vnu (often the default behavior is to use the WAR file's filename as the context root unless one is explicitly specified) you should be able to access the application by connecting to http://localhost/vnu/.

Note: You may want to customize the /WEB-INF/web.xml file inside the WAR file (you can use any ZIP-handling program) to modify the servlet filter configuration. For example, if you wanted to disable the inbound-size-limit filter, you could comment out that filter like this:

<!--
  <filter>
      <filter-name>inbound-size-limit-filter</filter-name>
      <filter-class>nu.validator.servlet.InboundSizeLimitFilter</filter-class>
  </filter>
  <filter-mapping>
      <filter-name>inbound-size-limit-filter</filter-name>
      <url-pattern>/*</url-pattern>
  </filter-mapping>
-->

HTTP client (for fast command-line checking)

The checker is packaged with an HTTP client you can use from the command line to either send documents to a locally-running instance of the checker HTTP service — for fast command-line checking — or to a remote instance anywhere on the Web.

To check documents locally using the packaged HTTP client, do this:

  1. Start up the checker as a local HTTP service, as described in the Standalone web server section.

  2. Open a new terminal window and invoke the HTTP client like this:

java -cp ~/vnu.jar nu.validator.client.HttpClient FILE.html...

vnu-runtime-image/bin/java nu.validator.client.HttpClient FILE.html...

To send documents to an instance of the checker on the Web, such as html5.validator.nu/, use the nu.validator.client.host and nu.validator.client.port options, like this:

java -cp ~/vnu.jar -Dnu.validator.client.port=80 \
    -Dnu.validator.client.host=html5.validator.nu \
    nu.validator.client.HttpClient FILE.html...

…or like this:

vnu-runtime-image/bin/java -Dnu.validator.client.port=80 \
    -Dnu.validator.client.host=html5.validator.nu \
    nu.validator.client.HttpClient FILE.html...

Other options are documented below.

HTTP client options

When using the packaged HTTP client for sending documents to an instance of the checker HTTP service for checking, you can set Java system properties to control configuration options for the checker behavior.

For example, you can suppress warning-level messages and only show error-level ones by setting the value of the nu.validator.client.level system property to error, like this:

java -Dnu.validator.client.level=error \
       -cp ~/vnu.jar nu.validator.client.HttpClient FILE.html...

…or like this:

vnu-runtime-image/bin/java -Dnu.validator.client.level=error \
       -cp ~/vnu.jar nu.validator.client.HttpClient FILE.html...

Most of the properties listed below map to the common input parameters for the checker service, as documented at github.com/validator/validator/wiki/Service-»-Common-params.

nu.validator.client.host

Specifies the hostname of the checker for the client to connect to.

default: "127.0.0.1"

nu.validator.client.port

Specifies the hostname of the checker for the client to connect to.

default: "8888"

example: java -Dnu.validator.client.port=8080 -jar ~/vnu.jar FILE.html

nu.validator.client.level

Specifies the severity level of messages to report; to suppress
warning-level messages, and only show error-level ones, set this property to
"error".

default: [unset]

possible values: "error"

example: java -Dnu.validator.client.level=error -jar ~/vnu.jar FILE.html

nu.validator.client.parser

Specifies which parser to use.

default: "html"; or, for *.xhtml input files, "xml"

possible values: [see information at URL below]

https://github.com/validator/validator/wiki/Service-%C2%BB-Common-params#parser

nu.validator.client.charset

Specifies the encoding of the input document.

default: [unset]

nu.validator.client.content-type

Specifies the content-type of the input document.

default: "text/html"; or, for *.xhtml files, "application/xhtml+xml"

nu.validator.client.out

Specifies the output format for messages.

default: "gnu"

possible values: [see information at URL below]

https://github.com/validator/validator/wiki/Service-%C2%BB-Common-params#out

nu.validator.client.asciiquotes

Specifies whether ASCII quotation marks are substituted for Unicode smart
quotation marks in messages.

default: "yes"

possible values: "yes" or "no"

HTTP servlet options

nu.validator.servlet.bind-address

Binds the validator service to the specified IP address.

default: 0.0.0.0 [causes the checker to listen on all interfaces]

possible values: The IP address of any network interface

example: -Dnu.validator.servlet.bind-address=127.0.0.1

nu.validator.servlet.connection-timeout

Specifies the connection timeout.

default: 5000

possible values: number of milliseconds

example: -Dnu.validator.servlet.connection-timeout=5000

nu.validator.servlet.socket-timeout

Specifies the socket timeout.

default: 5000

possible values: number of milliseconds

example: -Dnu.validator.servlet.socket-timeout=5000

Pulling the Docker image

You can pull the checker Docker image from https://ghcr.io/validator/validator in the GitHub container registry.

To pull and run the latest version of the checker:

  docker run -it --rm -p 8888:8888 ghcr.io/validator/validator:latest

To pull and run a specific tag/version of the checker from the container registry — for example, the 17.11.1 version:

  docker run -it --rm -p 8888:8888 ghcr.io/validator/validator:17.11.1

To bind the checker to a specific address (rather than have it listening on all interfaces):

  docker run -it --rm -p 128.30.52.73:8888:8888
  ghcr.io/validator/validator:latest

To make the checker run with a connection timeout and socket timeout different than the default 5 seconds, use the CONNECTION_TIMEOUT_SECONDS and SOCKET_TIMEOUT_SECONDS environment variables:

  docker run -it --rm \
     -e CONNECTION_TIMEOUT_SECONDS=15 \
     -e SOCKET_TIMEOUT_SECONDS=15 \
     -p 8888:8888 \
     validator/validator

To make the checker run with particular Java system properties set, use the JAVA_TOOL_OPTIONS environment variable:

  docker run -it --rm \
     -e JAVA_TOOL_OPTIONS=-Dnu.validator.client.asciiquotes=yes  \
     -p 8888:8888 \
     validator/validator

To define a service named vnu for use with docker compose, create a Compose file named docker-compose.yml (for example), with contents such as the following:

  version: '2' services:
    vnu:
      image: validator/validator ports:
        - "8888:8888"
      network_mode: "host" #so "localhost" refers to the host machine.

Build instructions

Follow the steps below to build, test, and run the checker such that you can open http://0.0.0.0:8888/ in a Web browser to use the checker Web UI.

  1. Make sure you have git, python, and JDK 8 or above installed.

  2. Set the JAVA_HOME environment variable:

    export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 <-- Ubuntu, etc.

    export JAVA_HOME=$(/usr/libexec/java_home) <-- MacOS

  3. Create a working directory:

    git clone https://github.com/validator/validator.git

  4. Change into your working directory:

    cd validator

  5. Start the checker Python script:

    python ./checker.py all

The first time you run the checker Python script, you’ll need to be online and the build will need time to download several megabytes of dependencies.

The steps above will build, test, and run the checker such that you can open http://0.0.0.0:8888/ in a Web browser to use the checker Web UI.

Warning: Future checker releases will bind by default to the address 127.0.0.1. Your checker deployment might become unreachable unless you use the --bind-address option to bind the checker to a different address:

    python ./checker.py --bind-address=128.30.52.73 all

Use python ./checker.py --help to see command-line options for controlling the behavior of the script, as well as build-target names you can call separately; e.g.:

  • python ./checker.py build # to build only

  • python ./checker.py build test # to build and test

  • python ./checker.py run # to run only

  • python ./checker.py jar # to compile vnu.jar

  • python ./checker.py update-shallow &&
      python ./checker.py dldeps &&
      python ./checker.py jar       # to compile vnu.jar faster

validator's People

Contributors

arttse avatar cvrebert avatar dd8 avatar dependabot[bot] avatar foolip avatar geertjanw avatar hsivonen avatar jacobq avatar kosek avatar krichter722 avatar malvoz avatar mariusj avatar mattgarrish avatar mdewilde avatar mhansen avatar mlc-kurosawatakeshi avatar mpparsley avatar niedziolkamichal avatar nschonni avatar rdeltour avatar saper avatar scop avatar scottaohara avatar shlomif avatar sideshowbarker avatar stevefaulkner avatar takenspc avatar xfq avatar xhmikosr avatar zcorpan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

validator's Issues

Unexpected select/option error

When validating the public page of W3C's Specberus, I am getting the following error:

Error: The first child option element of a select element with a required attribute and
       without a multiple attribute, and whose size is 1, must have either an empty
       value attribute, or must have no text content.
From line 105, column 29; to line 105, column 58
          <option value="no-validation">No val

However, even if the select element has a required attribute and no multiple attribute, its size is not 1:

<select class="form-control" id="validation" required>
    <option value="no-validation">No validation</option>
    <option value="simple-validation" selected>Simple Validation</option>
    <option value="recursive">Recursively validate multipart documents</option>
</select>

Am I missing something here, or did I unveil a validator bug?

Error Limit

When scanning websites like amazon.com there is a limit of 1003 errors,

it would be great to increase this limit via a parameter for the Standalone web server to a specific number or a maximum, which then displays all errors.

Make HTTP MaxConnPerRoute, MaxConnTotal, MaxRedirects configurable

In PrudentHttpEntityResolver we hardcode these values:

  • MaxConnPerRoute: 100
  • MaxTotalConnections: 200
  • MaxRedirects: 20*

Note that Sensible Defaults for Apache HttpClient also recommends those same MaxConnPerRoute and MaxTotalConnections values, and says Apache HTTP Compenents’ “Fluent API” uses those defaults too.

However, while those values seem sensible, it's conceivable that some people might want to be able to tune them for their checker deployments. So we should expose Java system properties for doing that.

*MaxConnPerRoute is set in VerifierServlet.java, then passed from there to PrudentHttpEntityResolver.

Problem with File Upload on https://validator.nu/

We rely on https://validator.nu/ for validating our XML-based .csl (Citation Style Language) files.

We always use these settings: https://validator.nu/?schema=https%3A%2F%2Fgithub.com%2Fcitation-style-language%2Fschema%2Fraw%2Fv1.0.1%2Fcsl.rnc&parser=xml&laxtype=yes&showsource=yes

but recently (somewhere since November) the File Upload option stopped working. It now gives the error: IO Error: Non-XML Content-Type: text/x-csl., so it looks like the "Be lax about HTTP Content-Type" check-box (laxtype=yes) is being ignored.

You should be able to replicate the issue by downloading and submitting the following file: https://raw.githubusercontent.com/citation-style-language/styles/master/apa.csl

MessageEmitterAdapter.setHtml(true) causes misspellings

Again, this is using the latest version from https://github.com/validator/validator.github.io .
Calling .setHtml(true) when initializing the MessageEmitterAdapter seems to cause the repetition of the first letter in the sentence of some validation messages:

  • "Aattribute href not allowed on element span at this point."
  • "Eelement p not allowed as child of element ul in this context. (Suppressing further errors from this subtree.)"

Here's the main relevant part of my code, although I think the bug should be reproducible without it: https://github.com/cvrebert/lmvtfy/blob/master/src/main/scala/com/chrisrebert/lmvtfy/validation/Html5Validator.scala
It's in Scala but heavily based on your SimpleCommandLineValidator. I'm happy to help out if you have any trouble reproducing the problem. I have a couple of reliable Specs2 testcases that catch the bug.

type-specific <input> attribute error message somewhat unclear

(I will fully understand if this ends up being closed due to infeasibility.)
If you try to validate

<input type="datetime" placeholder="Enter datetime">

you'll get an error because placeholder isn't permitted on inputs of type="datetime". The validator's HTML UI makes this clear by showing a helpful table of attributes with a highlighted row. However, this table isn't available when accessing the validator via its other interfaces. In such cases, one has to go by the error message alone:

Attribute placeholder not allowed on element input at this point.

which isn't so indicative/helpful in this case, since placeholder isn't a misspelled or completely absurd attribute for an input.
It would be nice if the error message made some reference to the type attribute in such cases.

Refs twbs/bootstrap#15971 (comment)

Changed output from validator.nu?

I use the html5check script, which uses validator.nu, to validate the code for several of my projects.
The last couple of days the test script stopped working. Has the output from validator.nu changed in the last couple of days? I have also reported this issue (mozilla/html5-lint#15) in the repo of the html5check script, however that script has not changed, so the 'cause' of the issues is probably a change in validator.nu .

Confirm whether slf4j, antlr, junit, jsontools dependencies are actually needed

As part of a set of changes made to the build.py script in 130dcd8 and in the interest of trimming some clutter out of the build, I recently removed the following dependencies:

  • antlr
  • junit
  • jsontools
  • slf4j

In my testing, the code builds and starts up and runs as expected without those, and the service seems to work as expected without them.

As far as I can glean, antlr, junit, and jsontools are only referenced in the htmlparser test-harness code, which don't actually use for the validator. So I think dropping those from the set of the dependencies the build downloads and puts into the classpath isn't going to have any unexpected effects.

But I'm less sure about slf4j. It seems like it may be used under some circumstances by the jetty code or maybe in the case where you're installing the vnu.war as an app within another servlet engine.

So @jacobq, can you please confirm whether or not the sl4j code needs to be included in the war file for some reason? If it turns out it's actually need in there, then I can restore it. But as far as I can see, even cases where sl4fj is actually needed, the need can be met by just separately downloading the sl4fj jar(s) and adding the jar(s) to your classpath.

But as far as the default behavior of the validator service goes, it doesn't seem to be relying on having sl4fj around at all—and if so, then I'd rather we not have it among the set of dependencies that we download and package up into vnu.jar and vnu.war.

Use https image-proxying service for the “Image report” feature

When users access a validator instance running under a non-insecure (https) origin (e.g, https://html5.validator.nu/) and use the “Image report” feature with an insecure (non-TLS http) document, the results page will cause the user to see a mixed-content warning indicator in the browser chrome.

To avoid causing users to get mixed content, we could have the checker use an https image-proxying service for all the images displayed in the “Image report” output; example:

https://sideshowbarker.net/tests/proxied-image.html

Details at https://carlo.zottmann.org/2013/04/14/google-image-resizer/

Consider adding an .eclipse-pmd file to the repo, for use with https://acanda.github.io/eclipse-pmd/

https://acanda.github.io/eclipse-pmd/ provides an Eclipse PMD plugin. As part of the setup for using it, a an Eclipse project can include a .eclipse-pmd with contents like this:

<?xml version="1.0" encoding="UTF-8"?>
<eclipse-pmd xmlns="http://acanda.ch/eclipse-pmd/0.8" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://acanda.ch/eclipse-pmd/0.8 http://acanda.ch/eclipse-pmd/eclipse-pmd-0.8.xsd">
  <analysis enabled="true" />
  <rulesets>
    <ruleset name="validator ruleset" ref="resources/pmd-ruleset.xml" refcontext="project" />
  </rulesets>
</eclipse-pmd>

This would be in addition adding an actual custom PMD ruleset to the repo—if we do end up adding one, as @rwhogg has proposed over at #48 (comment)

And note that the point of adding this wouldn’t be to require any contributors to use Eclipse—because we could automate the PMD using Ant, as @rwhogg mentions at #48 (comment) (and regardless, we don’t necessarily even need for all contributors to run a PMD check themselves—only reviewers would need to run it). So having this .eclipse-pmd file in the repo would just be an extra that we add to the project for the convenience of contributors who are actually using Eclipse.

html5 schema directory missing?

hi, sorry if this is a duplicate.

I have noticed that html5 directory is referenced in schema:
include "html5-svg-mathml.rnc"
include "html5/html5full-rdfa.rnc"

but this whole dir seems to be missing.

thanks, dan

Remove `research-src` tree?

Find out from @hsivonen whether it's OK to git rm -r research-src. If we do, it'll of course still be available in the repo history if we end up wanting to restore any of it for some reason.

As soon as w3c validator hits vnu on port 8888, it is killed

It runs...until the w3c validator calls it then immediately quits. I thought it was doing a validation, but it wasn't.

Is something else required to keep it running or is there a log of why it crashed/quit?

Thanks,

Steve

JAVA_PATH=/usr/bin java -Xss1024k -cp vnu.jar nu.validator.servlet.Main 8888

2014-11-15 12:01:53.953:INFO::Logging to STDERR via org.mortbay.log.StdErrLog
nu.validator.servlet.VerifierServletTransaction - Starting static initializer.
nu.validator.servlet.VerifierServletTransaction - Reading miscellaneous properties.
nu.validator.servlet.VerifierServletTransaction - Starting to loop over config file lines.
nu.validator.servlet.VerifierServletTransaction - Finished reading config.
nu.validator.servlet.VerifierServletTransaction - Converted config to arrays.
nu.validator.servlet.VerifierServletTransaction - Prepared namespace array.
nu.validator.servlet.VerifierServletTransaction - Parsed doctype numbers into ints.
nu.validator.servlet.VerifierServletTransaction - The cache path prefix is: null
nu.validator.servlet.VerifierServletTransaction - Parsing set up. Starting to read schemas.
nu.validator.servlet.VerifierServletTransaction - Will load schema: http://s.validator.nu/html5.rnc
nu.validator.servlet.VerifierServletTransaction - Will load schema: http://s.validator.nu/html5-its.rnc
nu.validator.servlet.VerifierServletTransaction - Will load schema: http://s.validator.nu/html5-rdfalite.rnc
nu.validator.servlet.VerifierServletTransaction - Will load schema: http://s.validator.nu/xhtml10/xhtml-strict.rnc
nu.validator.servlet.VerifierServletTransaction - Will load schema: http://s.validator.nu/xhtml10/xhtml-transitional.rnc
nu.validator.servlet.VerifierServletTransaction - Will load schema: http://s.validator.nu/xhtml10/xhtml-frameset.rnc
nu.validator.servlet.VerifierServletTransaction - Will load schema: http://s.validator.nu/xhtml5.rnc
nu.validator.servlet.VerifierServletTransaction - Will load schema: http://s.validator.nu/xhtml5-rdfalite.rnc
nu.validator.servlet.VerifierServletTransaction - Will load schema: http://s.validator.nu/xhtml1-ruby-rdf-svg-mathml.rnc
nu.validator.servlet.VerifierServletTransaction - Will load schema: http://s.validator.nu/svg-xhtml5-rdf-mathml.rnc
nu.validator.servlet.VerifierServletTransaction - Schemas read.
nu.validator.servlet.VerifierServletTransaction - Reading spec.
nu.validator.servlet.VerifierServletTransaction - Spec read.
nu.validator.servlet.VerifierServletTransaction - Initialization complete.
2014-11-15 12:02:04.098:INFO::jetty-20141013
2014-11-15 12:02:04.195:INFO::Started [email protected]:8888
Killed

The "Killed" shows up as soon as the validator tries to use it as its external handler for an 'html' file.

Add Support for TLS 1.1 and 1.2

The validator currently fails for sites with only TLS 1.1 and 1.2 enabled.

It reports this error:
IO Error: Remote host closed connection during handshake

Specifying a User-Agent?

Is it possible to specify a different User-Agent string per request? I've seen this can be set on the build, but can it be changed on runtime, like on the W3C legacy validator accepts a user-agent param?

This can help when validating web pages that respond with different contents depending on the User-Agent string, I've seen cases where the web developers were confused about getting issues related to content that they did not see when browsing the page, and thought there was some kind of cache.

For example, this is a validation of a page and this is the same validation with a browser-like User-Agent.

Gradle?

I started working on Gradle-scripts for building the Nu Validator. Check my fork for current progress. It is far from done! Is this something that you want? If not, I'll find something else to work on =) But if you want it I'll continue.

There are many reasons for using Gradle. For example new comitters will get into the code faster as they will recognize how the code is being built. Any problem with the build process can be googled...

No SNI support (fails with handshake_failure)

Error message from validator.nu: IO Error: Received fatal alert: handshake_failure

Might be due to Server Name Indication (SNI).

Examples:

Fix mixed-content problem in “Image report" feature.

When users access a validator instance running under a non-insecure (https) origin (e.g, https://html5.validator.nu/) and use the “Image report” feature with an insecure (non-TLS http) document, the results page will cause the user to see a mixed-content warning indicator in the browser chrome.

We need to make that not happen. Not sure what the best way would be but I’m now leaning toward to the idea of having the servlet code just do a transparent rewrite of the URLs on the backend.

Build failures: StackOverflowError and OutOfMemoryError

Following a recommendation in #30 (here), I have taken a stab at building the checker on a small VPS server with 1gb of main memory. It has a few other processes running, things are a little tight.

I'm getting StackOverflowError with this:

python ./build/build.py test

and OutOfMemoryError with this:

python ./build/build.py --stacksize=512

That looks like the machine just isn't big enough for the process. Would that be the right read, given that spec? (If so, I can apply for a larger VPS, but ... how big does it need to be?)

FTBFS on IA64

Using openjdk-6-jdk I do:
export JAVA_HOME=/usr//lib/jvm/java-6-openjdk-ia64/
python ./build/build.py all

and see
[jar] Building jar: /usr/src/validator/jing-trang/build/trang.jar
jar:

BUILD SUCCESSFUL
Total time: 18 seconds
The system is out of resources.
Consult the following stack trace for details.
java.lang.StackOverflowError
at com.sun.tools.javac.tree.JCTree$JCBinary.accept(JCTree.java:1539)
at com.sun.tools.javac.jvm.Gen.genExpr(Gen.java:832)
at com.sun.tools.javac.jvm.Gen.genCond(Gen.java:812)
at com.sun.tools.javac.jvm.Gen.genCond(Gen.java:765)
...

Stack size is limited to 8M on this system which has 8G of RAM.
There is nothing in the system logs to suggest a problem.

issue in build step

Hi Team ,
Getting below lines of error while making build as per given instruction in doc .Please suggest -

"java" -classpath util/dist/io-xml-util.jar nu.validator.tools.SaxCompiler xml-src/FormEmitter.xml src/nu/validator/servlet/FormEmitter.java
Exception in thread "main" java.lang.UnsupportedClassVersionError: nu/validator/tools/SaxCompiler : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)
"javac" -encoding UTF-8 -g -nowarn -classpath "./dependencies/commons-codec-1.4/commons-codec-1.4.jar:./dependencies/commons-httpclient-3.1/commons-httpclient-3.1.jar:./dependencies/commons-logging-1.1.1/commons-logging-1.1.1.jar:./dependencies/commons-logging-1.1.1/commons-logging-adapters-1.1.1.jar:./dependencies/commons-logging-1.1.1/commons-logging-api-1.1.1.jar:./dependencies/icu4j-charset-53_1.jar:./dependencies/icu4j-53_1.jar:./dependencies/iri-0.5/lib/iri.jar:./dependencies/jetty-6.1.26/lib/servlet-api-2.5-20081211.jar:./dependencies/jetty-6.1.26/lib/jetty-6.1.26.jar:./dependencies/jetty-6.1.26/lib/jetty-util-6.1.26.jar:./dependencies/jetty-6.1.26/lib/ext/jetty-ajp-6.1.26.jar:./dependencies/apache-log4j-1.2.15/log4j-1.2.15.jar:./dependencies/rhino1_7R1/js.jar:./dependencies/xerces-2_9_1/xercesImpl.jar:./dependencies/xerces-2_9_1/xml-apis.jar:./dependencies/slf4j-1.5.2/slf4j-log4j12-1.5.2.jar:./dependencies/commons-fileupload-1.2.1/lib/commons-fileupload-1.2.1.jar:./dependencies/isorelax.jar:./dependencies/mozilla/intl/chardet/java/dist/lib/chardet.jar:./dependencies/saxon9.jar:./dependencies/galimatias-0.1.0.jar:./dependencies/jsontools-core-1.5.jar:./dependencies/antlr.jar:./dependencies/xom-1.1.jar:./dependencies/junit-4.4.jar:./dependencies/apache-ant-1.7.0/lib/ant.jar:./dependencies/apache-ant-1.7.0/lib/ant-launcher.jar:./jars/non-schema.jar:./jars/io-xml-util.jar:./jars/htmlparser.jar:./jars/hs-aelfred2.jar:./jars/html5-datatypes.jar:jing-trang/build/jing.jar" -sourcepath "././src" -d "././classes" @temp-javac-list
././src/nu/validator/servlet/VerifierServletTransaction.java:749: error: cannot find symbol
PageEmitter.emit(contentHandler, this);
^
symbol: variable PageEmitter
location: class VerifierServletTransaction
././src/nu/validator/servlet/VerifierServletTransaction.java:1564: error: cannot find symbol
FormEmitter.emit(contentHandler, this);
^
symbol: variable FormEmitter
location: class VerifierServletTransaction
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
2 errors
"jar" cf "././dist/validator.jar" @temp-jar-list
"java" -classpath ./dependencies/commons-codec-1.4/commons-codec-1.4.jar:./dependencies/commons-httpclient-3.1/commons-httpclient-3.1.jar:./dependencies/commons-logging-1.1.1/commons-logging-1.1.1.jar:./dependencies/commons-logging-1.1.1/commons-logging-adapters-1.1.1.jar:./dependencies/commons-logging-1.1.1/commons-logging-api-1.1.1.jar:./dependencies/icu4j-charset-53_1.jar:./dependencies/icu4j-53_1.jar:./dependencies/iri-0.5/lib/iri.jar:./dependencies/jetty-6.1.26/lib/servlet-api-2.5-20081211.jar:./dependencies/jetty-6.1.26/lib/jetty-6.1.26.jar:./dependencies/jetty-6.1.26/lib/jetty-util-6.1.26.jar:./dependencies/jetty-6.1.26/lib/ext/jetty-ajp-6.1.26.jar:./dependencies/apache-log4j-1.2.15/log4j-1.2.15.jar:./dependencies/rhino1_7R1/js.jar:./dependencies/xerces-2_9_1/xercesImpl.jar:./dependencies/xerces-2_9_1/xml-apis.jar:./dependencies/slf4j-1.5.2/slf4j-log4j12-1.5.2.jar:./dependencies/commons-fileupload-1.2.1/lib/commons-fileupload-1.2.1.jar:./dependencies/isorelax.jar:./dependencies/mozilla/intl/chardet/java/dist/lib/chardet.jar:./dependencies/saxon9.jar:./dependencies/galimatias-0.1.0.jar:./dependencies/jsontools-core-1.5.jar:./dependencies/antlr.jar:./dependencies/xom-1.1.jar:./dependencies/junit-4.4.jar:./dependencies/apache-ant-1.7.0/lib/ant.jar:./dependencies/apache-ant-1.7.0/lib/ant-launcher.jar:./jars/non-schema.jar:./jars/io-xml-util.jar:./jars/htmlparser.jar:./jars/hs-aelfred2.jar:./jars/html5-datatypes.jar:./jars/validator.jar:jing-trang/build/jing.jar nu.validator.client.TestRunner --ignore=html-its tests/messages.json
Exception in thread "main" java.lang.UnsupportedClassVersionError: nu/validator/client/TestRunner : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)
java -XX:-DontCompileHugeMethods -Xms131072k -Xmx131072k -Xss512k -XX:ThreadStackSize=2048 -classpath ./dependencies/commons-codec-1.4/commons-codec-1.4.jar:./dependencies/commons-httpclient-3.1/commons-httpclient-3.1.jar:./dependencies/commons-logging-1.1.1/commons-logging-1.1.1.jar:./dependencies/commons-logging-1.1.1/commons-logging-adapters-1.1.1.jar:./dependencies/commons-logging-1.1.1/commons-logging-api-1.1.1.jar:./dependencies/icu4j-charset-53_1.jar:./dependencies/icu4j-53_1.jar:./dependencies/iri-0.5/lib/iri.jar:./dependencies/jetty-6.1.26/lib/servlet-api-2.5-20081211.jar:./dependencies/jetty-6.1.26/lib/jetty-6.1.26.jar:./dependencies/jetty-6.1.26/lib/jetty-util-6.1.26.jar:./dependencies/jetty-6.1.26/lib/ext/jetty-ajp-6.1.26.jar:./dependencies/apache-log4j-1.2.15/log4j-1.2.15.jar:./dependencies/rhino1_7R1/js.jar:./dependencies/xerces-2_9_1/xercesImpl.jar:./dependencies/xerces-2_9_1/xml-apis.jar:./dependencies/slf4j-1.5.2/slf4j-log4j12-1.5.2.jar:./dependencies/commons-fileupload-1.2.1/lib/commons-fileupload-1.2.1.jar:./dependencies/isorelax.jar:./dependencies/mozilla/intl/chardet/java/dist/lib/chardet.jar:./dependencies/saxon9.jar:./dependencies/galimatias-0.1.0.jar:./jars/non-schema.jar:./jars/io-xml-util.jar:./jars/htmlparser.jar:./jars/hs-aelfred2.jar:./jars/html5-datatypes.jar:./jars/validator.jar:jing-trang/build/jing.jar -Dnu.validator.servlet.read-local-log4j-properties=1 -Dnu.validator.servlet.log4j-properties=resources/log4j.properties -Dnu.validator.servlet.version=3 -Dnu.validator.servlet.service-name=Validator.nu -Dnu.validator.servlet.results-title=Validation results -Dorg.whattf.datatype.warn=true -Dnu.validator.servlet.about-page=https://about.validator.nu/ -Dnu.validator.servlet.user-agent=Validator.nu/LV -Dnu.validator.servlet.style-sheet=style.css -Dnu.validator.servlet.icon=icon.png -Dnu.validator.servlet.script=script.js -Dnu.validator.spec.html5-load=https://www.whatwg.org/specs/web-apps/current-work/ -Dnu.validator.spec.html5-link=https://www.whatwg.org/specs/web-apps/current-work/ -Dnu.validator.servlet.max-file-size=8388608 -Dnu.validator.servlet.connection-timeout=5000 -Dnu.validator.servlet.socket-timeout=5000 -Dnu.validator.servlet.follow-w3c-spec=0 -Dnu.validator.servlet.statistics=0 -Dorg.mortbay.http.HttpRequest.maxFormContentSize=8388608 -Dnu.validator.servlet.host.generic= -Dnu.validator.servlet.host.html5= -Dnu.validator.servlet.host.parsetree= -Dnu.validator.servlet.path.generic=/ -Dnu.validator.servlet.path.html5=/html5/ -Dnu.validator.servlet.path.parsetree=/parsetree/ nu.validator.servlet.Main 8888
Error: Could not find or load main class nu.validator.servlet.Main

Thanks,
Vivek

Add library usage in the readme

Hi,

The readme is complete if one wants to use the project as an executable.
It is harder to use when you want to use its validation capabilities as a library (e.g. in unit tests). Or maybe I missed something.

Otherwise, I created a Gist to document this case.
It is widely inspired from the command line validator. But it might help people to gain time if it was added in the project's readme.

PS: I spent the entire afternoon looking at solutions to validate HTML 5 pages in Java, and your solution is the best I found.

use of ARIA implicit semantics = warning

The use of default implicit role semantics is now a 'should not'
https://specs.webplatform.org/html-aria/webspecs/master/#document-conformance-requirements-for-use-of-aria-attributes-in-html
Suggest flagging a warning with reference to note

Setting an ARIA role and/or aria-* attribute that matches the default implicit ARIA semantics is unnecessary and is NOT RECOMMENDED as these properties are already set by the browser.
https://specs.webplatform.org/html-aria/webspecs/master/#h-note1

"A" vs. "An" grammar error in validation message

Apologies if this is already fixed in the not-yet-released code, but I'm using the latest release from https://github.com/validator/validator.github.io

$ java -jar vnu.jar http://jsbin.com/giquho/2/
"http://jsbin.com/giquho/2":20.6-20.6: error: Stray start tag “body”.
"http://jsbin.com/giquho/2":20.6-20.6: error: An “body” start tag seen but an element of the same type was already open.

Note the An “body”, which is grammatically incorrect.

New release?

What are the chances of getting a new release JAR any time soon?
I'd very much like to take advantage of meta@http-equiv=X-UA-Compatible no longer being an error.

ClassNotFoundException: org.mozilla.javascript.RhinoException

Using version 15.3.11 of the validator:

[error]    NoClassDefFoundError: : org/mozilla/javascript/RhinoException  (Html5DatatypeLibrary.java:90)
[error] nu.validator.datatype.Html5DatatypeLibrary.createDatatype(Html5DatatypeLibrary.java:90)
[error] nu.validator.datatype.Html5DatatypeLibrary.createDatatypeBuilder(Html5DatatypeLibrary.java:52)
[error] com.thaiopensource.relaxng.impl.SchemaBuilderImpl.makeDataPatternBuilder(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.DataExpr(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.PrimaryExpr(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.AnnotatedPrimaryExpr(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.UnaryExpr(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.Expr(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.ParenExpr(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.PrimaryExpr(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.AnnotatedPrimaryExpr(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.UnaryExpr(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.Expr(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.Define(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.Definition(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.GrammarComponent(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.GrammarBody(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.IncludedGrammar(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.parseInclude(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactParseable.parseAsInclude(Unknown Source)
[error] com.thaiopensource.relaxng.impl.SchemaBuilderImpl$IncludeImpl.endInclude(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.Include(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.GrammarComponent(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.GrammarBody(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.IncludedGrammar(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.parseInclude(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactParseable.parseAsInclude(Unknown Source)
[error] com.thaiopensource.relaxng.impl.SchemaBuilderImpl$IncludeImpl.endInclude(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.Include(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.GrammarComponent(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.GrammarBody(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.TopLevelGrammar(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.Input(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.parse(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactParseable.parse(Unknown Source)
[error] com.thaiopensource.relaxng.impl.SchemaBuilderImpl.parse(Unknown Source)
[error] com.thaiopensource.relaxng.impl.SchemaReaderImpl.createSchema(Unknown Source)
[error] com.thaiopensource.validate.AbstractSchemaReader.createSchema(Unknown Source)
[error] nu.validator.validation.SimpleDocumentValidator.schemaByUrl(SimpleDocumentValidator.java:112)
[error] nu.validator.validation.SimpleDocumentValidator.setUpMainSchema(SimpleDocumentValidator.java:140)
[error] com.chrisrebert.lmvtfy.validation.Html5Validator.validator$lzycompute(Html5Validator.scala:79)
[error] com.chrisrebert.lmvtfy.validation.Html5Validator.validator(Html5Validator.scala:77)
[error] com.chrisrebert.lmvtfy.validation.Html5Validator.validationErrors$lzycompute(Html5Validator.scala:52)
[error] com.chrisrebert.lmvtfy.validation.Html5Validator.validationErrors(Html5Validator.scala:51)
[error] com.chrisrebert.lmvtfy.validation.Html5Validator$.validationErrorsFor(Html5Validator.scala:42)
[error] ValidatorSpec$$anonfun$1$$anonfun$apply$1.apply(ValidatorSpec.scala:29)
[error] ValidatorSpec$$anonfun$1$$anonfun$apply$1.apply(ValidatorSpec.scala:28)
[error] nu.validator.datatype.Html5DatatypeLibrary.createDatatype(Html5DatatypeLibrary.java:90)
[error] nu.validator.datatype.Html5DatatypeLibrary.createDatatypeBuilder(Html5DatatypeLibrary.java:52)
[error] com.thaiopensource.relaxng.impl.SchemaBuilderImpl.makeDataPatternBuilder(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.DataExpr(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.PrimaryExpr(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.AnnotatedPrimaryExpr(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.UnaryExpr(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.Expr(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.ParenExpr(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.PrimaryExpr(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.AnnotatedPrimaryExpr(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.UnaryExpr(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.Expr(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.Define(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.Definition(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.GrammarComponent(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.GrammarBody(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.IncludedGrammar(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.parseInclude(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactParseable.parseAsInclude(Unknown Source)
[error] com.thaiopensource.relaxng.impl.SchemaBuilderImpl$IncludeImpl.endInclude(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.Include(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.GrammarComponent(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.GrammarBody(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.IncludedGrammar(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.parseInclude(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactParseable.parseAsInclude(Unknown Source)
[error] com.thaiopensource.relaxng.impl.SchemaBuilderImpl$IncludeImpl.endInclude(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.Include(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.GrammarComponent(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.GrammarBody(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.TopLevelGrammar(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.Input(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.parse(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactParseable.parse(Unknown Source)
[error] com.thaiopensource.relaxng.impl.SchemaBuilderImpl.parse(Unknown Source)
[error] com.thaiopensource.relaxng.impl.SchemaReaderImpl.createSchema(Unknown Source)
[error] com.thaiopensource.validate.AbstractSchemaReader.createSchema(Unknown Source)
[error] nu.validator.validation.SimpleDocumentValidator.schemaByUrl(SimpleDocumentValidator.java:112)
[error] nu.validator.validation.SimpleDocumentValidator.setUpMainSchema(SimpleDocumentValidator.java:140)
[error] com.chrisrebert.lmvtfy.validation.Html5Validator.validator$lzycompute(Html5Validator.scala:79)
[error] com.chrisrebert.lmvtfy.validation.Html5Validator.validator(Html5Validator.scala:77)
[error] com.chrisrebert.lmvtfy.validation.Html5Validator.validationErrors$lzycompute(Html5Validator.scala:52)
[error] com.chrisrebert.lmvtfy.validation.Html5Validator.validationErrors(Html5Validator.scala:51)
[error] com.chrisrebert.lmvtfy.validation.Html5Validator$.validationErrorsFor(Html5Validator.scala:42)
[error] ValidatorSpec$$anonfun$1$$anonfun$apply$1.apply(ValidatorSpec.scala:29)
[error] ValidatorSpec$$anonfun$1$$anonfun$apply$1.apply(ValidatorSpec.scala:28)
[error] 
[error] Caused by java.lang.ClassNotFoundException: org.mozilla.javascript.RhinoException
[error] nu.validator.datatype.Html5DatatypeLibrary.createDatatype(Html5DatatypeLibrary.java:90)
[error] nu.validator.datatype.Html5DatatypeLibrary.createDatatypeBuilder(Html5DatatypeLibrary.java:52)
[error] com.thaiopensource.relaxng.impl.SchemaBuilderImpl.makeDataPatternBuilder(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.DataExpr(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.PrimaryExpr(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.AnnotatedPrimaryExpr(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.UnaryExpr(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.Expr(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.ParenExpr(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.PrimaryExpr(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.AnnotatedPrimaryExpr(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.UnaryExpr(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.Expr(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.Define(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.Definition(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.GrammarComponent(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.GrammarBody(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.IncludedGrammar(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.parseInclude(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactParseable.parseAsInclude(Unknown Source)
[error] com.thaiopensource.relaxng.impl.SchemaBuilderImpl$IncludeImpl.endInclude(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.Include(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.GrammarComponent(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.GrammarBody(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.IncludedGrammar(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.parseInclude(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactParseable.parseAsInclude(Unknown Source)
[error] com.thaiopensource.relaxng.impl.SchemaBuilderImpl$IncludeImpl.endInclude(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.Include(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.GrammarComponent(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.GrammarBody(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.TopLevelGrammar(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.Input(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactSyntax.parse(Unknown Source)
[error] com.thaiopensource.relaxng.parse.compact.CompactParseable.parse(Unknown Source)
[error] com.thaiopensource.relaxng.impl.SchemaBuilderImpl.parse(Unknown Source)
[error] com.thaiopensource.relaxng.impl.SchemaReaderImpl.createSchema(Unknown Source)
[error] com.thaiopensource.validate.AbstractSchemaReader.createSchema(Unknown Source)
[error] nu.validator.validation.SimpleDocumentValidator.schemaByUrl(SimpleDocumentValidator.java:112)
[error] nu.validator.validation.SimpleDocumentValidator.setUpMainSchema(SimpleDocumentValidator.java:140)
[error] com.chrisrebert.lmvtfy.validation.Html5Validator.validator$lzycompute(Html5Validator.scala:79)
[error] com.chrisrebert.lmvtfy.validation.Html5Validator.validator(Html5Validator.scala:77)
[error] com.chrisrebert.lmvtfy.validation.Html5Validator.validationErrors$lzycompute(Html5Validator.scala:52)
[error] com.chrisrebert.lmvtfy.validation.Html5Validator.validationErrors(Html5Validator.scala:51)
[error] com.chrisrebert.lmvtfy.validation.Html5Validator$.validationErrorsFor(Html5Validator.scala:42)
[error] ValidatorSpec$$anonfun$1$$anonfun$apply$1.apply(ValidatorSpec.scala:29)
[error] ValidatorSpec$$anonfun$1$$anonfun$apply$1.apply(ValidatorSpec.scala:28)

html5 schema directory missing

Hi,
where can I find the validator/schema/html5 directory? In some files (for example validator/schema/html5-all.rnc) there are references to this directory.

Regards,
Philipp Glatza

Different JSON structure and details when checking from web or command line

When checking the same page, first on the web interface, and then from the command line, I'm getting a different JSON structure and different details. The issues reported are the same, but the web version includes additional details like the extract and hilite:

https://gist.github.com/jaimeiniesta/4f8bc92c00e8341002b8

I'm using the latest validator release (16 February 2015), on OSX Yosemite with this Java version:

java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-466.1-11M4716)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-466.1, mixed mode)

Is this difference intentional? Is there a way to get the same JSON structure on both, or at least to have as well the extra details that the web version has?

Can this be related with the Java version I'm using and if so, which one is the recommended to use validator?

Thank you!

Bad value “bookmark” for attribute “rel” on element “link”

I am validating a webpage containing:
<link rel="bookmark" title='Privatperson' href='/wps/portal/privatpers' hreflang="sv"/>

And I am getting:
Bad value “bookmark” for attribute “rel” on element “link”: The string “bookmark” is not a registered keyword.

But "bookmark" should be valid, according to:
http://www.w3.org/MarkUp/html3/dochead.html

https://validator.nu/?doc=http%3A%2F%2Fwww.forsakringskassan.se%2Farbetsgivare

Nightlies: Test them

So I've added a step to my development workflow such that, going forward from now on, Nightly builds of the vnu.jar and vnu.war executables will be available here:

https://sideshowbarker.net/nightlies/

The workflow is such that I'll only upload a new nightly there if I've made a bug fix or enhancement to the actual application code (as opposed to the build files or the docs).

So the biggest benefit of this is that other packagers won't have to wait for me to get around to updating the change log, etc., and doing a formal release. Otherwise the intent is that the nightlies are intended to be just as stable (in terms of the application behavior) as the normal releases; e.g., I do exactly the same level of testing for each.

So @cvrebert @jzaefferer @jaimeiniesta especially, please give the current nightly jar there a try and let me know if you find any problems. And @jacobq and @Pacoup especially, please try out the war file.

ARIA role="timer" on element <time>

As stated in both HTML5 and HTML 5.1 Nightly, the <time> element can be asigned any ARIA role value and WAI-ARIA 1.0 defines timer as a valid ARIA role. Yet, validating

<!DOCTYPE html><html><head><title>Timer</title></head><body><p>

<time role="timer" aria-label="Countdown" datetime="10s"><samp>10</samp> seconds</time>

</p></body></html>

leads to

Error: Bad value timer for attribute role on element time.

Add option to validate all specified files

The validator currently ignores files that don't match the html or xhtml extensions. That makes sense when crawling directories. For the grunt-html plugin, which resolves files and only passes a list of specific files as argument, an option to check all files independent of their extension would allow validating other formats.

See also validator/grunt-html#37 (comment)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.