3. Conformance Definition

Contents

This section is normative.

The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC2119].

3.1. Document Conformance

In this document, the use of the word 'schema' refers to any definition of the syntax of XHTML 2, regardless of the definition language used.

3.1.1. Strictly Conforming Documents

A strictly conforming XHTML 2.0 document is a document that requires only the facilities described as mandatory in this specification. Such a document must meet all the following criteria:

  1. The document must conform to the constraints expressed in the schemas in Appendix B - XHTML 2.0 RELAX NG Definition, Appendix D - XHTML 2.0 Schema and Appendix F - XHTML 2.0 Document Type Definition.

  2. The local part of the root element of the document must be html.

  3. The start tag of the root element of the document must explicitly contain an xmlns declaration for the XHTML 2.0 namespace [XMLNS]. The namespace URI for XHTML 2.0 is defined to be http://www.w3.org/2002/06/xhtml2.

    The start tag must also contain an xsi:schemaLocation attribute. The schema location for XHTML 2.0 is defined to be TBD.

    An example root element might look like:

    <html xmlns="http://www.w3.org/2002/06/xhtml2" 
          xml:lang="en"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://www.w3.org/2002/06/xhtml2 TBD"
    >
    
  4. There must be a DOCTYPE declaration in the document prior to the root element. If present, the public identifier included in the DOCTYPE declaration must reference the DTD found in Appendix F using its Public Identifier. The system identifier may be modified appropriately.

    <!DOCTYPE
     html PUBLIC "-//W3C//DTD XHTML 2.0//EN"
     "TBD">
    

Here is an example of an XHTML 2.0 document.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 2.0//EN"
    "TBD">
<html xmlns="http://www.w3.org/2002/06/xhtml2" 
          xml:lang="en"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.w3.org/2002/06/xhtml2 TBD"
>
  <head>
    <title>Virtual Library</title>
  </head>
  <body>
    <p>Moved to <a href="http://vlib.org/">vlib.org</a>.</p>
  </body>
</html>

Note that in this example, the XML declaration is included. An XML declaration like the one above is not required in all XML documents. XHTML document authors are strongly encouraged to use XML declarations in all their documents. Such a declaration is required when the character encoding of the document is other than the default UTF-8 or UTF-16 and no encoding was determined by a higher-level protocol.

3.2. XHTML Family User Agent Conformance

A conforming user agent must meet all of the following criteria:

  1. The user agent must parse and evaluate an XHTML 2 document for well-formedness. If the user agent claims to be a validating user agent, it must also validate documents against a referenced schema according to [XML].
  2. When the user agent claims to support facilities defined within this specification or required by this specification through normative reference, it must do so in ways consistent with the facilities' definition.
  3. When a user agent processes an XHTML 2 document as generic XML, it shall only recognize attributes of type ID (e.g., the id attribute on most XHTML 2 elements) as fragment identifiers.
  4. If a user agent encounters an element it does not recognize, it must continue to process the content of that element.
  5. If a user agent encounters an attribute it does not recognize, it must ignore the entire attribute specification (i.e., the attribute and its value).
  6. If a user agent encounters an attribute value it doesn't recognize, it must use the default attribute value.
  7. If it encounters an entity reference (other than one of the predefined entities) for which the user agent has processed no declaration (which could happen if the declaration is in the external subset which the user agent hasn't read), the entity reference should be rendered as the characters (starting with the ampersand and ending with the semi-colon) that make up the entity reference.
  8. When rendering content, user agents that encounter characters or character entity references that are recognized but not renderable should display the document in such a way that it is obvious to the user that normal rendering has not taken place.
  9. White space is handled according to the rules of [XML]. All elements preserve whitespace.

    The user agent must use the definition from CSS for processing white space characters [CSS3-TEXT].

  10. In the absence of a style-sheet, including user agents that do not process stylesheets, visual presentation should be as if the user agent used the CSS stylesheet specified in Appendix H.