XLXP Examples

XHTML Basic Example


R4R provide basic XHTML Tutorials concept with XHTML Examples .Through R4R you can develop XHTML programming concept. R4R provide XHTML Interview Questions with answers.R4R provide XHTML Languages study materials in easy way.

Introduction of XHTML

XHTML stands for extensible HyperText Markup Language and is a cross between HTML and XML. XHTML was developed by the W3C to help web developers make the transition from HTML to XML.

XHTML was created for two main reasons
  1. To create a stricter standard for making web pages, reducing incompatibilities between browsers.
  2. To create a standard that can be used on a variety of different devices without changes.
The Main Changes

There are several main changes in XHTML from HTML

  1. All tags must be in lower case
  2. All documents must have a doctype
  3. All documents must be properly formed
  4. All tags must be closed
  5. All attributes must be added properly
  6. The name attribute has changed
  7. Attributes cannot be shortened
  8. All tags must be properly nested
History of XHTML

HTML was originally Developed by Tim Berners-Lee, now director of the World Wide Web Consortium, keepers and communicators of most internet standards. XHTML1 is a reformulation of HTML4, which was SGML-based, as XML. The changes are of a mere syntactic nature and not visible to the end-user.

XHTML1 comes in three different flavors:
  • Strict: no layout information is included, the recommended way to implement pages.
  • Transitional: includes support for older, visual elements, which are deprecated.
  • Frameset: includes support for frames, sub-areas on a single site with parallel display of pages.
  • Difference Between HTML and XHTML
    XHTML is case-sensitive HTML is not case-sensitive
    XHTML, being XML, must be well-formed. Every element must have an end tag, or use the self-closing tag syntax HTML allows some end tags and even some start tags to be omitted.
    All attributes must have a value in XHTML HTML allows some attributes (e.g., selected) to be minimised.
    All attribute values must be surrounded by double or single quotes HTML allows quotes to be omitted if the value contains only alphanumeric characters (and some others).
    XHTML allows the use of CDATA sections HTML does not
    In XHTML, non-empty elements require both a start and an end tag In HTML, certain elements allow the omission of either or both
    XHTML allows the use of processing instructions HTML does not
    In XHTML, tag names and attribute names are case sensitive In HTML, they are case insensitive.
    XHTML uses XML parsing requirements HTML uses its own which are defined much more closely to the way browsers actually handle HTML today.
    Why we use XHTML

    We use XHTML because of some important reasons those are given below

  • XHTML can run on all new browsers.
  • It is an combination of HTML and XML so, it support many important features of them.
  • XHTML also give us facility to write well formed document.
  • Advantage of XHTML
    1. It is the first step toward a modular and extensible web based on XML.
    2. It provides the bridge for web designers to enter the web of the future, while still being able to maintain compatibility with today's HTML 4 browsers.
    3. Develop sophisticated behaviours that work across multiple browsers and platforms.
    4. Comply with accessibility laws and guidelines without sacrificing beauty, performance, or sophistication.
    5. Redesign in hours instead of days or weeks, reducing costs.
    6. It can be used by mobile devices.
    7. It is possible to use XML tools with it.
    XHTML Tutorials
    XHTML Examples
    XHTML Interview Materials