Minimal XHTML 1.1 Document Tests

Introduction

This is a small collection of XHTML tests I have written to test how browsers treat minimal XHTML 1.1 documents.

Table of Contents

  1. Example from XHTML 1.1
  2. Valid variants
  3. Combinations of variants as tests
    1. text/html without xml prolog
    2. text/xml without xml prolog
    3. text/html with xml prolog
    4. text/xml with xml prolog
  4. Local file testing
  5. Expected results

Example from XHTML 1.1

XHTML 1.1 has an example of a minimal XHTML 1.1 document. Here is that same document with only a few minor title and paragraph content changes: (posted here: Minimal XHTML 1.1 Document)

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
    "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
  <head>
    <title>Minimal XHTML 1.1 Document</title>
  </head>
  <body>
    <p>This is a minimal <a href="http://www.w3.org/TR/xhtml11">XHTML 1.1</a> document.</p>
  </body>
</html>

The XHTML 1.1 example document is a step better than the corresponding Minimal XHTML 1.0 Document in that it fully specifies the location of its DTD and thus works "as-is" with validating processors.

Valid variants

There are a few valid variants of this example that should also be tested:

Combinations of variants as tests

Here are all four possible combinations of the abovementioned two variants, from "most html-like" to "most xml-like". (The assumption is that the prolog is "closer" to the document than the mime-type and therefore may have greater impact upon how the browser decides to treat the document.)

  1. text/html without ?xml prolog: xhtml11withoutprolog.html (note: valid XHTML 1.1)
  2. text/xml without ?xml prolog: xhtml11withoutprolog.xml (note: valid XHTML 1.1)
  3. text/html with ?xml prolog: xhtml11withprolog.html (note: valid XHTML 1.1)
  4. text/xml with ?xml prolog: xhtml11withprolog.xml (note: valid XHTML 1.1)

Local file testing

Try downloading (using the given file names) the above four tests (1-4) to your client machine and viewing them locally in your browser. See if it treats local files differently from those that it receives from the web.

Expected results

All four test documents are valid XHTML 1.1 documents, and therefore should be handled as XHTML - not as plain XML. Each document has little bit of text, and one hyperlink to the XHTML 1.1 specification. The hyperlink should be functional and rendered in the browser's default style for HTML hyperlinks. Here is what each document should have looked like (margins chosen to match popular browser conventions - actual styling may vary):

  1. text/html without ?xml prolog:

    This is a minimal XHTML 1.1 document without ?xml prolog served as text/html.

  2. text/xml without ?xml prolog:

    This is a minimal XHTML 1.1 document without ?xml prolog served as text/xml.

  3. text/html with ?xml prolog:

    This is a minimal XHTML 1.1 document with ?xml prolog served as text/html.

  4. text/xml with ?xml prolog:

    This is a minimal XHTML 1.1 document with ?xml prolog served as text/xml.

Last updated by Tantek Çelik 20010801. Valid HTML 4.0 Strict! Valid CSS!