user227248
user227248

Reputation: 89

What is the DOCTYPE legacy string for?

In the place of the short DOCTYPE <!DOCTYPE html>, according to the HTML5 specification, a DOCTYPE legacy string or an obsolete permitted DOCTYPE string may be used as a DOCTYPE. If an obsolete permitted DOCTYPE string is for backward compatibility then what is a DOCTYPE legacy string for? The standard states that it is for HTML generators that cannot output HTML markup with the short DOCTYPE. What in the world are HTML generators? If the HTML generators they are talking about are programs supporting previous versions of HTML5, I think an obsolete permitted DOCTYPE string is a perfect candidate, instead of a DOCTYPE legacy string, because it is the situation that an obsolete permitted DOCTYPE string is looking for.

Upvotes: 1

Views: 237

Answers (1)

Alohci
Alohci

Reputation: 82976

This was primarily for XSLT. XSLT is perfectly capable of producing HTML5, except that in XSLT 1.0 at least, it has no means of describing "output <!DOCTYPE html>", so the DOCTYPE legacy string allows XSLT to output valid HTML5.

The phrasing in the spec is just a generified way of permitting that.

Upvotes: 0

Related Questions