Skip to content
Related Articles

Related Articles

HTML vs XML
  • Difficulty Level : Easy
  • Last Updated : 29 Oct, 2020
GeeksforGeeks - Summer Carnival Banner

HTML: HTML (Hyper Text Markup Language) is used to create web pages and web applications. It is a markup language. By HTML we can create our own static page. It is used for displaying the data not to transport the data. HTML is the combination of Hypertext and Markup language. Hypertext defines the link between the web pages. A markup language is used to define the text document within tag which defines the structure of web pages. This language is used to annotate (make notes for the computer) text so that a machine can understand it and manipulate text accordingly.

Example:




<!DOCTYPE html>
<html
<head
    <title>GeeksforGeeks</title
</head
<body
    <h1>GeeksforGeeks</h1
    <p>A Computer Science portal for geeks</p
</body
</html

Output:

XML: XML (eXtensible Markup Language) is also used to create web pages and web applications. It is dynamic because it is used to transport the data not for displaying the data. The design goals of XML focus on simplicity, generality, and usability across the Internet. It is a textual data format with strong support via Unicode for different human languages. Although the design of XML focuses on documents, the language is widely used for the representation of arbitrary data structures such as those used in web services.

Example:






<?xml version = "1.0"?> 
<contactinfo
    <address category = "college"
        <name>G4G</name
        <College>Geeksforgeeks</College
        <mobile>2345456767</mobile
    </address
</contactinfo

Output:

G4G
Geeksforgeeks
2345456767

Difference between HTML and XML: There are many differences between HTML and XML. These important differences are given below:

HTMLXML
HTML stands for Hyper Text Markup Language.XML stands for extensible Markup Language.
HTML is static.XML is dynamic.
HTML is a markup language.XML provides framework to define markup languages.
HTML can ignore small errors.XML does not allow errors.
HTML is not Case sensitive.XML is Case sensitive.
HTML tags are predefined tags.XML tags are user defined tags.
There are limited number of tags in HTML.XML tags are extensible.
HTML does not preserve white spaces.White space can be preserved in XML.
HTML tags are used for displaying the data.XML tags are used for describing the data not for displaying.
In HTML, closing tags are not necessary.In XML, closing tags are necessary.

full-stack-img

My Personal Notes arrow_drop_up
Recommended Articles
Page :