This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 21383 - JSON output for the HTML validator doesn't return the detected/forced doctype
Summary: JSON output for the HTML validator doesn't return the detected/forced doctype
Status: NEW
Alias: None
Product: Validator
Classification: Unclassified
Component: Templates (show other bugs)
Version: HEAD
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: This bug has no owner yet - up for the taking
QA Contact: qa-dev tracking
Depends on:
Reported: 2013-03-25 05:33 UTC by Art McBain
Modified: 2013-03-25 06:15 UTC (History)
0 users

See Also:


Description Art McBain 2013-03-25 05:33:25 UTC
When asking the HTML validator to output in "SOAP 1.2", it returns the following:

<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="">
<m:markupvalidationresponse env:encodingStyle="" xmlns:m="">

This includes the doctype of the page. The API ( ) indicates this is the detected or doctype or that forced by the validator for validation.

What I think would be great, and provide parity with the SOAP 1.2 output would be for the JSON output to provide the doctype. The JSON output for the same website is reproduced below:

    "url": "",
    "messages": [
    "source": {
        "encoding": "utf-8",
        "type": "text/html"

I know the output of the JSON is intended to match that of's, but it seems quite the oversight to not return the doctype. Even more so that the data provided by the output formats differs even though they are known to have the same source of data.
Comment 1 Art McBain 2013-03-25 06:15:08 UTC
is the detected doctype or that forced*

Also, the JSON output for in a roundabout way it does provide the "schema" it used to validate a document.

Produces the following:

{"url":"","messages":[{"type":"info","message":"The Content-Type was “text/htmlâ€. Using the HTML parser."},{"type":"info","message":"Using the schema for HTML5 + SVG 1.1 + MathML 3.0 + RDFa Lite 1.1."}]}

Which indicates what it validated against in the last message. Though I much prefer the shorter more programmatic output of the W3's SOAP 1.2 doctype tag.

Earlier I had indicated the format was intended to match's (which I found at ), but it seems this only applies to the existence of the "url" and "message" properties and the format of messages listed in the latter. Thus the doctype used for validation could be included in the extra source block, or as a property of the root (like "url") without harming this compatibility.