Talk:Document type declaration

From Wikipedia, the free encyclopedia
  (Redirected from Talk:Document Type Declaration)
Jump to: navigation, search
WikiProject Computing (Rated Start-class)
WikiProject icon This article is within the scope of WikiProject Computing, a collaborative effort to improve the coverage of computers, computing, and information technology on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
Start-Class article Start  This article has been rated as Start-Class on the project's quality scale.
 ???  This article has not yet received a rating on the project's importance scale.

Doctype semantics[edit]

Anonymous edits from removed these claims (which were mine), saying they were misunderstandings:

  • The DOCTYPE declares the document as being of 'type' "html" (or whatever the root element is declared to be).
    • This was removed altogether, and made to say that the DOCTYPE just includes a DTD by reference. I concede that the original phrasing wasn't the way I really intended to express things, but I did mean to say more than just that there's a reference to a DTD. I meant to say that the DOCTYPE declares the document as being of a particular 'type' as defined by two pieces of information: a particular DTD, and a clarification of which element type declared in the DTD must be used as the root element, since DTDs are sometimes ambiguous in this regard. Would you disagree with that?
      • I would not disagree with the two pieces of information but I do disagree with them being characterized as the "type" of the document. People tend to understand as the "type" of the document having values like HTML, DocBook, TEI, etc. -- The maker of the anon edits
  • The root element, if given in the DOCTYPE, must match the document's actual root element.
    • This got changed to just say that the root element is declared to be "html" (in the example). With the original phrasing, I wanted to imply that the root element did not necessarily need to be given (in XML, at least, it is optional, although I believe it was an oversight in the grammar) and also that there is a validation requirement associated with it: in XML, at least, if the root element is named in the DOCTYPE, then the name of the document's actual root element must match. Is this irrelevant?
  • The SYSTEM identifier is used when the DTD cannot be obtained via the PUBLIC identifier.
    • This was changed to say that a processor may use either ID, as it chooses, to know what DTD to use. I think you're correct; I had assumed, based on a particular catalog implementation, that public IDs were preferred when both were available.

mjb 20:39, 30 October 2005 (UTC)

Anonymous edits from User: removed some previously researched stuff saying "The HTML5 doctype doesn't care about your root element".

  • No, but when it does appear while in the XHTML syntax or in any polyglots, XML rules, which _do_ care about the root element, also apply. RobSimpson (talk) 18:24, 2 September 2009 (UTC)
    • <!doctype HTML:html> is invalid in polyglots, as section 9.1.1 of the HTML 5 working draft clearly specifies. The removed text implied that it was somehow relevant to HTML 5, and not just XHTML 5; this is certainly incorrect. Your example appears to be valid in XHTML 5, but only because XHTML 5 follows XML's definition of a doctype. If it would be useful to note this example, it should probably be in a section that generically deals with XML.

      (BTW, I'm not – we were discussing this at irc:// and both corrected some errors at the same time.) —Simetrical (talk • contribs) 03:24, 3 September 2009 (UTC)

doctype 4.0 transitional[edit]

Netscape Composer 4.77 insists on generating HTML that starts:

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">

but 4.0 is not listed as among current doctypes. And these statements are supposedly case sensitive, and the proper form of this statement is apparently:

<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN">

but whether correcting case that way does any good is not clear, since the current validators may not recognize 4.0 as valid in any event. Which all leaves open the question of how various real-world browsers treat such HTML webpages. What is the optimum way to hand patch the doctype in code generated by 4.77? Tidy seems to want to change it to XHTML 1.0:

!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

It's all pretty weird, considering that many millions of webpages must have been generated by 4.77, and many must still be floating around in cyberspace. 00:15, 18 January 2007 (UTC)

Yes that is weird. however, the validator accepts 4.0 trans, as long as you capitilize it correctly.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

works. Bawolff 02:46, 2 February 2007 (UTC)

XHTML Print[edit]

Doesn't XHTML Print have a DTD too? --Stefán Örvarr Sigmundsson 03:37, 28 October 2007 (UTC)

HTML 5 Doctype[edit]

Shouldn't we clarify that the HTML 5 doctype can also be written with HTML in lower case, like this:

<!DOCTYPE html>

a short string of markup... ?[edit]

The first section is really not well written, and an even bigger issue is: that there has been no effort to make it understandable to laypersons.

In particular the last line of the first paragraph. "It manifests itself as", what is "It"? And what is that "short string of markup"? And no reason to use a verbose and cumbersome expression as: "it manifests itself". I personally don't think that the 'serialized' word should be there. I thought a file/document was by definition serialized? Maybe I'm wrong.

There is smth wrong in section DTD's -> Syntax, in the paragraph beginning with "In XML, the root element ...". It seems like somebody pasted too much in. The last parenthesis is not closed, and it does not really make sense.

Velle (talk) 16:29, 27 August 2011 (UTC)

<!doctype html> for non-HTML5[edit]

Should it be noted that <!doctype html> will work - as in push the browser into Standards mode, rather than Quirks mode - for < HTML5 in all browsers with the exception of IE<=5.5? (talk) 14:07, 2 December 2011 (UTC)

XML declaration and quirks mode[edit]

Should it be pointed out that by including the XML declaration with the XHTML doctype, the page will render in quirks mode in IE6? Frosteduser (talk) 02:31, 20 May 2012 (UTC)

ALL CAPS[edit]

The doctype no longer needs to be capitalized in HTML5, and in articles it's virtually always written in lowercase (in my experience). It's worth considering making it lowercase here as well. (talk) 03:38, 11 April 2014 (UTC)

External links modified[edit]

Hello fellow Wikipedians,

I have just modified one external link on Document type declaration. Please take a moment to review my edit. If you have any questions, or need the bot to ignore the links, or the page altogether, please visit this simple FaQ for additional information. I made the following changes:

When you have finished reviewing my changes, you may follow the instructions on the template below to fix any issues with the URLs.

You may set the |checked=, on this template, to true or failed to let other editors know you reviewed the change. If you find any errors, please use the tools below to fix them or call an editor by setting |needhelp= to your help request.

  • If you have discovered URLs which were erroneously considered dead by the bot, you can report them with this tool.
  • If you found an error with any archives or the URLs themselves, you can fix them with this tool.

If you are unable to use these tools, you may set |needhelp=<your help request> on this template to request help from an experienced user. Please include details about your problem, to help other editors.

Cheers.—InternetArchiveBot (Report bug) 23:29, 11 September 2017 (UTC)