I'm looking for a machine-readable version of the HTML5 specs, akin to a DTD, although any format would do as long as it's parsable.
The HTML5 specs don't seem to contain anything of the sort so my first idea was to look into validators. I dug into the sources of the validator.nu validator but it seems that the schema they use is build by parsing the specs (e.g. parsing its HTML and its english text) and I'll have to build the validator to generate it.
More specifically, I'm looking for a list of elements, their content models, and a list of their attributes with their type and whether they are required or they have a default value.
Finally, I should mention that I'm not looking for validating specific documents. I would use W3C's validator, or validator.nu directly. I'm looking for the specs so that I can use them in my own applications.
The term HTML5 is essentially a buzzword that refers to a set of modern web technologies. This includes the HTML Living Standard, along with JavaScript APIs to enhance storage, multimedia, and hardware access. You may sometimes hear about "new HTML5 elements", or find HTML5 described as a new version of HTML.
Why is HTML5 so important? HTML5 is one element that will allow you to do almost everything you want online without needing extra software. Not only that, HTML5 is also free, works across all devices and all modern browsers support it.
Since 2014-10-28 the HTML5 is a recommendation (!)... But this question is not obsolete (the validators now are more complex tham simple DTD).
there are no simple parser, as @ruediste clues show... Today, perhaps the best parser is at https://validator.nu/ ... so,
Trawling through W3's site I can only see two things of interest on this:
I've looked as hard as you probably have with nothing concrete. I think validator.nu's approach is the best as the working draft is likely to change several times before a specification is ever agreed upon. If someone did publish an unofficial DTD it would need constant maintenance.
+1 great question, I wish I could find a concrete answer. I hope someone else can!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With