XHTML Test Suite (Beta Version)

This test suite contains documents for testing XHTML support in browsers. Some of the test documents are correct while others are intentionally incorrect. Each document contains the same (possibly abridged) testing area.

The wording in the testing area is always the same (written to assume that the document should display) whether the document is correct or not. Please refer to the legend below to determine whether a particular test is supposed to work or whether it is intentionally incorrect.

Warning: Some of the tests will send your browser data in a format the browser does not expect. If your browser can’t deal with that kind of situation properly, you may experience a crash. If you don’t accept this risk, please do not load the test documents.

Why ”Beta”?

I left this suite as ”beta” on 2001-07-27, because the content type issues related to XHTML were unresolved and I had verified the validity of the tests only using tools that were originally designed to be used with SGML—not XML. As of 2002-05-05 the W3C has published a Note about the content type issue, but I haven’t yet had time to update the classification of the tests below to reflect the guidelines. Also, initial testing with XML validation tools suggest that some tests might not be valid if the documents are marked standalone as they are now.

The Tests

Test name application/xhtml+xml application/xml text/xml text/html
HTML 4.01 Transitional (not XHTML)Ill-formedIll-formedIll-formedHTML
XHTML BasicXHTMLXML-XHTMLXML-XHTMLSoup
XHTML 1.1XHTMLXML-XHTMLXML-XHTMLSoup
XHTML 1.0 Strict in compliance with the HTML Compatibility GuidelinesXHTMLXML-XHTMLXML-XHTMLHTML
XHTML 1.0 Transitional in compliance with the HTML Compatibility GuidelinesXHTMLXML-XHTMLXML-XHTMLHTML
DTDless generic XHTMLXHTML-NSXML-XHTMLXML-XHTMLSoup
DTDless generic XHTML with “html” as the namespace prefixXHTML-NSXML-XHTMLXML-XHTMLText
DTDless generic XHTML with an arbitrary namespace prefixXHTML-NSXML-XHTMLXML-XHTMLText
DTDless generic almost XHTML with a wrong namespace (URL of the HTML 4.0 specification)Text-NSText-NSText-NSSoup
DTDless generic almost XHTML with a wrong namespace (URL of the HTML 4.0 specification) and “html” as the namespace prefixText-NSText-NSText-NSText
DTDless generic almost XHTML with an arbitrary namespaceTextTextTextSoup
DTDless generic almost XHTML with an arbitrary namespace and “html” as the namespace prefixTextTextTextText
DTDless generic almost XHTML without a namespace and with “html” as an undeclared namespace prefixTextTextTextText

Legend

TypeDescription
XHTMLThese are valid XHTML documents served as application/xhtml+xml. XHTML user agents are expected to display these documents with the XHTML semantics (subject to the capabilities of the user agent—eg. an XHTML Basic user agent isn’t expected to support XHTML elements beyond those included in XHTML Basic). Also XML user agents with support for the XHTML namespace are expected to display these documents with the XHTML semantics.
XML-XHTMLThese documents are served using either of the generic XML content types. XML user agents with support for the XHTML namespace are expected to display these documents with the XHTML semantics.
XHTML-NSThese documents are served as application/xhtml+xml and use namespace features. The rules about what may be served as application/xhtml+xml and to what extent XHTML user agents are required to support namespaces are unclear at the time of writing. Hence, it is unclear how XHTML user agents should deal with these documents. If full namespace features are allowed, the user agents are expected to display these documents with the XHTML semantics.
HTMLHTML user agents are expected to display these documents with the HTML semantics.
SoupSending documents like this as text/html is wrong. However, HTML user agents that implement lenient HTML parsing are likely to display these documents with the HTML semantics.
Text-NSThese documents have an improper namespace. Strictly speaking, user agents are supposed to only display a dump of the text content of these documents without the XHTML semantics. However, in practice some user agents will apply the XHTML semantics to these documents for historic reasons.
TextThese documents shouldn’t have XHTML or HTML semantics applied to them. Instead, a well-behaved user agent is expected to only display a dump of the text content in these documents. If a user agent applies the XHTML semantics to these documents, the user agent is doing the wrong thing.
Ill-formedThese documents are served using content types that imply XML parsing. However, the documents are not well-formed. A conforming XML parser should report an error and not process the document beyond the </head> tag. If a user agent displays these documents, the user agent is in serious error.

Diagnosing Common Problems

User agent displays Text-NS tests with the XHTML semantics but not XHTML tests.
The user agent doesn’t use the correct XHTML namespace URI. Instead, it uses the URL of the HTML 4.0 specification as the namespace URI. The URL of the HTML 4.0 specification was (unfortunately) used as an example in the Namespaces in XML specification. However, it didn’t become the final namespace URI.
User agent displays the tests with the “html” prefix using the XHTML semantics but doesn’t display the other tests correctly
The user agent cheats and doesn’t implement namespaces correctly. It associates the XHTML semantics with the prefix rather than the namespace URI.
User agent tries to initiate a generic file download
The user agent doesn’t have internal support for the particular content type.