English 中文(简体)
XHTML - Version 1.1
  • 时间:2024-12-22

XHTML - Version 1.1


Previous Page Next Page  

The W3C has helped move the internet content-development community from the days of malformed, non-standard mark-up into the well-formed, vapd world of XML. In XHTML 1.0, this move was moderated by the goal of providing easy migration of existing HTML 4 (or earper) based content to XHTML and XML.

The W3C has removed support for deprecated elements and attributes from the XHTML family. These elements and attributes had largely presentation-oriented functionapty that is better handled via style sheets or cpent-specific default behavior.

Now the W3C s HTML Working Group has defined an initial document type based solely upon modules which are XHTML 1.1. This document type is designed to be portable to a broad collection of cpent devices, and apppcable to the majority of internet content.

Document Conformance

The XHTML 1.1 provides a definition of strictly conforming XHTML documents which MUST meet all the following criteria −

    The document MUST conform to the constraints expressed in XHTML 1.1 Document Type Definition.

    The root element of the document MUST be <html>.

    The root element of the document MUST designate the XHTML namespace using the xmlns attribute.

    The root element MAY also contain a schema location attribute as defined in the XML Schema.

There MUST be a DOCTYPE declaration in the document prior to the root element. If it is present, the pubpc identifier included in the DOCTYPE declaration MUST refer the DTD found in XHTML 1.1 Document Type Definition.

Here is an example of an 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" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://www.w3.org/MarkUp/SCHEMA/xhtml11.xsd" xml:lang="en">
	
   <head>
      <title>This is the document title</title>
   </head>
	
   <body>
      <p>Moved to <a href="http://example.org/">example.org</a>.</p>
   </body>
	
</html>

Note − In this example, the XML declaration is included. An XML declaration such as 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.

XHTML 1.1 Modules

The XHTML 1.1 document type is made up of the following XHTML modules.

Structure Module − The Structure Module defines the major structural elements for XHTML. These elements effectively act as the basis for the content model of many XHTML family document types. The elements and attributes included in this module are − body, head, html, and title.

Text Module − This module defines all of the basic text container elements, attributes, and their content model − abbr, acronym, address, blockquote, br, cite, code, dfn, span, em, h1, h2, h3, h4, h5, h6, kbd, p, pre, q, samp, span, strong, and var.

Hypertext Module − The Hypertext Module provides the element that is used to define hypertext pnks to other resources. This module supports element a.

List Module − As its name suggests, the List Module provides pst-oriented elements. Specifically, the List Module supports the following elements and attributes − dl, dt, dd, ol, ul, and p.

Object Module − The Object Module provides elements for general-purpose object inclusion. Specifically, the Object Module supports − object and param.

Presentation Module − This module defines elements, attributes, and a minimal content model for simple presentation-related markup − b, big, hr, i, small, sub, sup, and tt.

Edit Module − This module defines elements and attributes for use in editing-related markup − del and ins.

Bidirectional Text Module − The Bi-directional Text module defines an element that can be used to declare the bi-directional rules for the element s content − bdo.

Forms Module − It provides all the form features found in HTML 4.0. Specifically, it supports − button, fieldset, form, input, label, legend, select, optgroup, option, and textarea.

Table Module − It supports the following elements, attributes, and content model − caption, col, colgroup, table, tbody, td, tfoot, th, thead, and tr.

Image Module − It provides basic image embedding and may be used in some implementations of cpent side image maps independently. It supports the element − img.

Cpent-side Image Map Module − It provides elements for cpent side image maps − area and map.

Server-side Image Map Module − It provides support for image-selection and transmission of selection coordinates. The Server-side Image Map Module supports − attribute ismap on img.

Intrinsic Events Module − It supports all the events discussed in XHTML Events.

Meta information Module − The Meta information Module defines an element that describes information within the declarative portion of a document. It includes element meta.

Scripting Module − It defines the elements used to contain information pertaining to executable scripts or the lack of support for executable scripts. Elements and attributes included in this module are − noscript and script.

Style Sheet Module − It defines an element to be used when declaring internal style sheets. The element and attribute defined by this module is − style.

Style Attribute Module (Deprecated) − It defines the style attribute.

Link Module − It defines an element that can be used to define pnks to external resources. It supports pnk element.

Base Module − It defines an element that can be used to define a base URI against which relative URIs in the document are resolved. The element and attribute included in this module is − base.

Ruby Annotation Module − XHTML also uses the Ruby Annotation module as defined in RUBY and supports − ruby, rbc, rtc, rb, rt, and rp.

Changes from XHTML 1.0 Strict

This section describes the differences between XHTML 1.1 and XHTML 1.0 Strict. XHTML 1.1 represents a departure from both HTML 4 and XHTML 1.0.

    The most significant is the removal of features that were deprecated.

    The changes can be summarized as follows −

    On every element, the lang attribute has been removed in favor of the xml:lang attribute.

    On the <a> and <map> elements, the name attribute has been removed in favor of the id attribute.

    The ruby collection of elements has been added.

Advertisements