Headings: [Skip]

Web-Design Tutorials by Dr Sam

XHTML Strict Specs, Part 2

Menu [Skip]

XML Declaration

Warning (temporary)

Problem

The placement of the XML Declaration can cause a problem with some browser versions currently.

  • Some browser versions, still in use, expect to find a DTD at the start of a document.
  • Those browsers will revert to quirks mode if they do not find a DTD at the very start. Quirks mode is a browser's own built-in way of interpreting mark-up language.

    more info. ]

    More Info:

    Ishida, Richard, "'Standards' vs. 'Quirks' Mode," Tutorial: Character sets & encodings in XHTML, HTML and CSS W3C Domain Architecture (W3C).

  • The results may be different between the standards mode, represented by the DTD, on the one hand and the quirks mode on the other hand.

Solution

Currently, we can avoid the problem by omitting the XML Declaration.

  • It is not needed with XHTML.
  • Your XHTML will validate without it.
  • So, just omit the XML Declaration if you want to.

Eventually, the problem should disappear as those browsers fall into disuse; and we will be able to use the XML Declaration without hesitation at that time (predictably).



Web-Design Tutorials by Dr Sam
tutorials list
contact | about
© copyright, cc: by-nc-nd