Difference Between XML vs XHTML


Xml stands for Extensible Markup Language. It means that the user can define own set of tags. It makes XML more flexible than HTML. XML tags represent the logical structure of data and can be interpreted and used in different ways by different applications. XML inherits the feature of SGNL and combines the feature of HTML with it. The major framework is taken from SGML.


XML is a Meta language to describe other languages. It can be used to create a markup language for a specific purpose. XML resembles and complements HTML. XML describe data, such as student name, marks and address. HTML defines the tags that describe the display of data such as with bulleted list or table. XML allows the developer to define an unlimited set of tags thus bringing great flexibility to the users.


XHTML stands for extendible Hypertext Markup Language. It combines the formatting language. It combines formatting strengths of HTML 4.0 and the data structure and extensibility strengths of XML . It uses the tags and attributes of the HTML along with the syntax of XML. The first version of XHTML 1.0 was released in 2000. The World Wide Web Consortium (W3C) Sets of standard for XHTML and Other internet languages. XHTML was created for two main reasons.

  • To create a more steict standard for making web pages and reduce incompatibilities between browsers.
  • To create a standard that can be used on different devices without changes.

Changes in XHTML from HTML

There are several main changes in XHTML from HTML:

  • All lags must be in lower case.
  • All documents must have a doc type.
  • All documents must be properly formed.
  • All tags must be added properly.
  • The name attribute has changed.
  • Attributes cannot be shorted.
  • All tags must be properly nested.

Flavors of XHTML 1.0

Three flavors of XHTML 1.0 are as follows:

  1. XHTML Transitional
  2. XHTML Frameset
  3. XHTML Strict

XHTML Transitional

The most commonly used version of XHTML is 1.0. This version mostly resembles with HTML 4.0.1 . It is the best choice when document needs to use HTMLs presentational elements or when pages need to be developed without using the style sheets. This version is used to converted existing HTML pages to XHTML. It also does not provide support for frames.

HTML Frameset

XHTML Framset version should be used when the document need to use the fram element to divide the browser into multiple windows. It also support the elements set of XHTML Transitional.

XHTML Strict

XHTML Strict most closely represents the future of XTML.  The element set for HTML Strict contains a subject of the elements from XHTML Transitional. However, It does not include support for strictly presentational elements and elements that will not be included in future version of XHTML. In the future, XHTML documents will separate presentation from content and use style sheet to define presentation formatting such as font types, colors and styles. XHTML Strict should be used with Cascading style Sheet (CSS).

Differences between XHTML and HTML

The different between XHTML and HTML is as follows:

  • XHTML documents contain the XML and DOCTYPE declaration at the top of the documents. XML declaration is optional but DOCTYPE declaration is required . The DOCTYPE declaration was optional in HTML. XHTML requires that all WebPages contain <HTML>, <HEAD>, <BODY> elements.
  • XHTML documents must be well formatted. However, HTML not strictly require well formatted documents.
  • XHTML requires closing tag for every element. HTML does not require closely tag strictly.
  • XHTML requires all attributes should be enclosed in quotation marks. HTML does not require quotation marks. However they are require around attributes values that consists of only letters, numbers and the character dash, period, underscore and colon.
  • XHTML elements and attributes are case sensitive but HTML elements and attributes are not.

Discussion & Feed Back:
If you want to ask any question from us or with other students, please participate in discussion sectionor email on

Got Something To Say: