From MobileRead
Jump to: navigation, search

XHTML is a markup language that has the same depth of expression as HTML but includes the construction rules of XML. As of version 1.1 it is broken into modules that each define a portion of the language. It also defines MHTML for email (eml) files.


[edit] It is HTML

The tags for XHTML are really the same tags that are used in HTML. However many optional features that browsers allow are not allowed in XHTML. For example in HTML you can start a paragraph with <p> and never bother to close it. When the Web Browser sees another tag it will close the paragraph automatically. In XHTML the closing </p> is required. Like the XML that it is derived from all tags are lower case.

If a tag is fully defined by itself there must be a special close to tell HTML about it. For example a <br> in HTML would be coded as <br /> with the / indicating that this tag is fully defined without any further data.

In addition some of the HTML tags have been deprecated in favor of a CSS implementation. For example the <center> tag.

A program like Htmltidy can fix some of the problems caused by the more stringent requirements and identify others for the user to fix.

Like HTML it supports the full list of HTML entities as defined in Entity reference and includes the apos from XML.

[edit] XHTML basic

This is a standard implementation defined as a W3C specification. It is the minimal set of tags that must be supported to allow the format to be defined as legal XHTML. It is defined for Web clients such as mobile phones, PDAs, pagers, and set top boxes. The document type is rich enough for content authoring.

The style element is not supported but external style sheets are encouraged following CSS rules. The link element can be used to include external style sheets. The div and span elements and the class attribute are supported to hook style information onto the structure. The script and noscript elements are not supported. Usually small devices have limited memory and CPU power. Execution of script programs may not be supported. Contents should be readable even if scripts are not executed.

Tables are supported but not nested tables. Authors should follow the Web content accessibility guidelines to allow tables to be used on small screens. Images are supported.

XHTML Basic consists of the following XHTML modules:

  • Structure Module: body, head, html, title
  • Text Module: abbr, acronym, address, blockquote, br, cite, code, dfn, div, em, h1, h2, h3, h4, h5, h6, kbd, p, pre, q, samp, span, strong, var
  • Hypertext Module: a
  • List Module: dl, dt, dd, ol, ul, li
  • Basic Forms Module: form, input, label, select, option, textarea
  • Basic Tables Module: caption, table, td, th, tr
  • Image Module: img
  • Object Module: object, param
  • Metainformation Module: meta
  • Link Module: link
  • Base Module: base
  • Comments: <!-- comments will be ignore between these symbols. -->

[edit] ePUB

ePUB is a eBook reading format that uses XHTML as its basic text format. In particular the section ePUB XHTML describes the portion of XHTML standard keywords that ePUB uses.

[edit] Definition

The overall definition is provided in the code below: (Follow the links in the code for module definitions. View the source for this page for copyright data.)

<!ENTITY % XHTML.version  "-//W3C//DTD XHTML 1.1//EN" >

<!ENTITY % NS.prefixed "IGNORE" >
<!ENTITY % XHTML.prefix "xhtml" >

<!ENTITY % XHTML.global.attrs.prefixed "INCLUDE" >

<!ENTITY % XLINK.xmlns "" >
<!ENTITY % XLINK.xmlns.attrib "" >

<!ENTITY % XHTML.profile  "" >

<!ENTITY % xhtml-notations.module "IGNORE" >


<?doc type="doctype" role="title" { XHTML 1.1 } ?>

<!ENTITY % xhtml-prefw-redecl.module "IGNORE" >

<!ENTITY % xhtml-events.module "INCLUDE" >

<!ENTITY % xhtml-inlstyle.module "INCLUDE" >
<!ENTITY % xhtml-inlstyle.mod
    PUBLIC "-//W3C//ELEMENTS XHTML Inline Style 1.0//EN"
           "http://www.w3.org/MarkUp/DTD/xhtml-inlstyle-1.mod" >

<!ENTITY % xhtml-model.mod
    PUBLIC "-//W3C//ENTITIES XHTML 1.1 Document Model 1.0//EN"
           "http://www.w3.org/MarkUp/DTD/xhtml11-model-1.mod" >

<!ENTITY % xhtml-framework.module "INCLUDE" >
<!ENTITY % xhtml-framework.mod
    PUBLIC "-//W3C//ENTITIES XHTML Modular Framework 1.0//EN"
           "http://www.w3.org/MarkUp/DTD/xhtml-framework-1.mod" >

<!ENTITY % xhtml-postfw-redecl.module "IGNORE" >

<!ENTITY % xhtml-text.module "INCLUDE" >
<!ENTITY % xhtml-text.mod
    PUBLIC "-//W3C//ELEMENTS XHTML Text 1.0//EN"
           "http://www.w3.org/MarkUp/DTD/xhtml-text-1.mod" >

<!ENTITY % xhtml-hypertext.module "INCLUDE" >
<!ENTITY % xhtml-hypertext.mod
    PUBLIC "-//W3C//ELEMENTS XHTML Hypertext 1.0//EN"
           "http://www.w3.org/MarkUp/DTD/xhtml-hypertext-1.mod" >

<!ENTITY % xhtml-list.module "INCLUDE" >
<!ENTITY % xhtml-list.mod
    PUBLIC "-//W3C//ELEMENTS XHTML Lists 1.0//EN"
           "http://www.w3.org/MarkUp/DTD/xhtml-list-1.mod" >

<!ENTITY % xhtml-edit.module "INCLUDE" >
<!ENTITY % xhtml-edit.mod
    PUBLIC "-//W3C//ELEMENTS XHTML Editing Elements 1.0//EN"
           "http://www.w3.org/MarkUp/DTD/xhtml-edit-1.mod" >

<!ENTITY % xhtml-bdo.module "%XHTML.bidi;" >
<!ENTITY % xhtml-bdo.mod
    PUBLIC "-//W3C//ELEMENTS XHTML BIDI Override Element 1.0//EN"
           "http://www.w3.org/MarkUp/DTD/xhtml-bdo-1.mod" >

<!ENTITY % Ruby.common.attlists "INCLUDE" >
<!ENTITY % Ruby.common.attrib "%Common.attrib;" >
<!ENTITY % xhtml-ruby.module "INCLUDE" >
<!ENTITY % xhtml-ruby.mod
    PUBLIC "-//W3C//ELEMENTS XHTML Ruby 1.0//EN"
           "http://www.w3.org/TR/ruby/xhtml-ruby-1.mod" >

<!ENTITY % xhtml-pres.module "INCLUDE" >
<!ENTITY % xhtml-pres.mod
    PUBLIC "-//W3C//ELEMENTS XHTML Presentation 1.0//EN"
           "http://www.w3.org/MarkUp/DTD/xhtml-pres-1.mod" >

<!ENTITY % xhtml-link.module "INCLUDE" >
<!ENTITY % xhtml-link.mod
    PUBLIC "-//W3C//ELEMENTS XHTML Link Element 1.0//EN"
           "http://www.w3.org/MarkUp/DTD/xhtml-link-1.mod" >

<!ENTITY % xhtml-meta.module "INCLUDE" >
<!ENTITY % xhtml-meta.mod
    PUBLIC "-//W3C//ELEMENTS XHTML Metainformation 1.0//EN"
           "http://www.w3.org/MarkUp/DTD/xhtml-meta-1.mod" >

<!ENTITY % xhtml-base.module "INCLUDE" >
<!ENTITY % xhtml-base.mod
    PUBLIC "-//W3C//ELEMENTS XHTML Base Element 1.0//EN"
           "http://www.w3.org/MarkUp/DTD/xhtml-base-1.mod" >

<!ENTITY % xhtml-script.module "INCLUDE" >
<!ENTITY % xhtml-script.mod
    PUBLIC "-//W3C//ELEMENTS XHTML Scripting 1.0//EN"
           "http://www.w3.org/MarkUp/DTD/xhtml-script-1.mod" >

<!ENTITY % xhtml-style.module "INCLUDE" >
<!ENTITY % xhtml-style.mod
    PUBLIC "-//W3C//ELEMENTS XHTML Style Sheets 1.0//EN"
           "http://www.w3.org/MarkUp/DTD/xhtml-style-1.mod" >

<!ENTITY % xhtml-image.module "INCLUDE" >
<!ENTITY % xhtml-image.mod
    PUBLIC "-//W3C//ELEMENTS XHTML Images 1.0//EN"
           "http://www.w3.org/MarkUp/DTD/xhtml-image-1.mod" >

<!ENTITY % xhtml-csismap.module "INCLUDE" >
<!ENTITY % xhtml-csismap.mod
    PUBLIC "-//W3C//ELEMENTS XHTML Client-side Image Maps 1.0//EN"
           "http://www.w3.org/MarkUp/DTD/xhtml-csismap-1.mod" >

<!ENTITY % xhtml-ssismap.module "INCLUDE" >
<!ENTITY % xhtml-ssismap.mod
    PUBLIC "-//W3C//ELEMENTS XHTML Server-side Image Maps 1.0//EN"
           "http://www.w3.org/MarkUp/DTD/xhtml-ssismap-1.mod" >

<!ENTITY % xhtml-param.module "INCLUDE" >
<!ENTITY % xhtml-param.mod
    PUBLIC "-//W3C//ELEMENTS XHTML Param Element 1.0//EN"
           "http://www.w3.org/MarkUp/DTD/xhtml-param-1.mod" >

<!ENTITY % xhtml-object.module "INCLUDE" >
<!ENTITY % xhtml-object.mod
    PUBLIC "-//W3C//ELEMENTS XHTML Embedded Object 1.0//EN"
           "http://www.w3.org/MarkUp/DTD/xhtml-object-1.mod" >

<!ENTITY % xhtml-table.module "INCLUDE" >
<!ENTITY % xhtml-table.mod
    PUBLIC "-//W3C//ELEMENTS XHTML Tables 1.0//EN"
           "http://www.w3.org/MarkUp/DTD/xhtml-table-1.mod" >

<!ENTITY % xhtml-form.module "INCLUDE" >
<!ENTITY % xhtml-form.mod
    PUBLIC "-//W3C//ELEMENTS XHTML Forms 1.0//EN"
           "http://www.w3.org/MarkUp/DTD/xhtml-form-1.mod" >

<!ENTITY % xhtml-target.module "INCLUDE" >
<!ENTITY % xhtml-target.mod
    PUBLIC "-//W3C//ELEMENTS XHTML Target 1.0//EN"
           "http://www.w3.org/MarkUp/DTD/xhtml-target-1.mod" >

<!ENTITY % xhtml-legacy.module "IGNORE" >
<!ENTITY % xhtml-legacy.mod
    PUBLIC "-//W3C//ELEMENTS XHTML Legacy Markup 1.0//EN"
           "http://www.w3.org/MarkUp/DTD/xhtml-legacy-1.mod" >

<!ENTITY % xhtml-struct.module "INCLUDE" >
<!ENTITY % xhtml-struct.mod
    PUBLIC "-//W3C//ELEMENTS XHTML Document Structure 1.0//EN"
           "http://www.w3.org/MarkUp/DTD/xhtml-struct-1.mod" >

[edit] For more information

http://www.w3.org/TR/2009/NOTE-xhtml-media-types-20090116/ - Covers guidelines from creating web documents in XHTML and by extension ePUB documents.

Personal tools

MobileRead Networks