I am building a newsletter builder in PHP and one of my requirements is that once the email has been composed in HTML it is checked to see if it meets the w3 standards and a notice is thrown to the end user if any invalid errors are found from the validation run.
At of the moment I am using the w3validator API via a PHP Curl request following this: https://github.com/validator/validator/wiki/Service:-Input:-POST-body
My problem is that I can't seem to get the validator to process the html content using the XHTML1 doctype. By default, it expects to see the HTML5 doctype, and although there is the ability to set a query string parameter ('parser'), it seems the minimum version I am able to test is HTML4.
I have also tried leaving the 'parser' parameter both blank and with the value 'html' which should have made the validator use the doctype set in the html content for its validation, but this doesn't work either.
Is it possible to use the w3standards api to valid XHTML1? And if not is there an alternative API that would allow for us to do so?