This is a small collection of XHTML tests I have written to test how browsers treat minimal XHTML 1.1 documents.
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.
There are a few valid variants of this example that should also be tested:
is not required in all XML documentsand goes on to state that
XHTML document authors are strongly encouraged to use XML declarations in all their documents.A strong encouragement is however, not a requirement and therefore the ?xml prolog is optional in XHTML 1.1 documents.
text/html
or text/xml
or application/xml
.
It is left quite open ended as to which of those the author should choose.
Hence it makes sense to at least test examples served as "text/html" (.html) and "text/xml" (.xml).
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.)
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.
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):
This is a minimal XHTML 1.1 document without ?xml prolog served as text/html.
This is a minimal XHTML 1.1 document without ?xml prolog served as text/xml.
This is a minimal XHTML 1.1 document with ?xml prolog served as text/html.
This is a minimal XHTML 1.1 document with ?xml prolog served as text/xml.