0% found this document useful (1 vote)
448 views

XHTML and HTML

XHTML is an XML-based markup language that is similar to and extends HTML. It was developed as a more rigorous version of HTML based on XML. XHTML documents must be well-formed XML documents, whereas HTML documents do not have to be well-formed. Key differences between HTML and XHTML include that XHTML requires closing all tags, using lowercase for all tags and attributes, including a doctype, and specifying attributes within quotes. To migrate an XHTML document to HTML, changes such as removing the XML namespace and declaration and changing the document type are needed.

Uploaded by

Anshika Tiwari
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (1 vote)
448 views

XHTML and HTML

XHTML is an XML-based markup language that is similar to and extends HTML. It was developed as a more rigorous version of HTML based on XML. XHTML documents must be well-formed XML documents, whereas HTML documents do not have to be well-formed. Key differences between HTML and XHTML include that XHTML requires closing all tags, using lowercase for all tags and attributes, including a doctype, and specifying attributes within quotes. To migrate an XHTML document to HTML, changes such as removing the XML namespace and declaration and changing the document type are needed.

Uploaded by

Anshika Tiwari
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Difference between XHTML and HTML

1. XHTML : 
XHTML stands for Extensible Hypertext Markup Language. It can be
considered as a part of the XML markup language this is because of
XHTML have features of both XML and HTML. XHTML is extended from
XML and HTML. XHTML can be considered as a better version of HTML. 

2. HTML : 
HTML is the Hypertext Markup Language which is the most widely used
language over the internet. HTML is used to create web pages and link them
from one to another. Please note HTML is not a programming language, it is a
markup language. We can use different other technologies as like CSS
and javascript to give a new look to the pages developed by HTML. 
Difference between HTML and XHTML : 
 
S.No. HTML XHTML
1. HTML stands for Hypertext Markup XHTML stands for Extensible Hypertext
Language. Markup Language.
2. It was developed by Tim Berners-Lee. It was developed by W3C i.e World Wide
Web Consortium.
3. It was developed in 1991. It was released in 2000.
4. It is extended from SGML. It is extended from XML and HTML.
5. The format is a document file format. The format is a markup language.
6. All tags and attributes are not In this, every tag and attribute should be in
necessarily to be in lower or upper lower case.
case.
7. Doctype is not necessary to write at Doctype is very necessary to write at the
the top. top of the file.
8. It is not necessary to close the tags in It is necessary to close the tags in the order
the order they are opened. they are opened.
9. While using the attributes it is not While using the attributes it is mandatory to
necessary to mention quotes.  For e.g. mention quotes.  For e.g. <Geeks=”GFG”>.
<Geeks>. 
10. Filename extension used Filename extension are .xhtml, .xht, .xml.
are .html, .htm.
How to migrate from XHTML to HTML
To understand the subtle differences between HTML and XHTML, consider
the transformation of a valid and well-formed XHTML 1.0 document into a valid
HTML 4.01 document. To make this translation requires the following steps:

 The language for an element should be specified with a lang attribute rather


than the XHTML xml:lang attribute. XHTML uses XML's built in language-
defining functionality attribute.
 Remove the XML namespace (xmlns=URI). HTML has no facilities for
namespaces.
 Change the document type declaration from XHTML 1.0 to HTML 4.01.
 If present, remove the XML declaration. (Typically this is: <?xml
version="1.0" encoding="utf-8"?>).
 Ensure that the document’s MIME type is set to text/html. For both HTML
and XHTML, this comes from the HTTP Content-Type header sent by the
server.
 Change the XML empty-element syntax to an HTML style empty element
(<br/> to <br>).

You might also like