Extensible Markup Language (XML) is a markup language that defines a set of rules for encoding documents in a format that is both human-readable and machine-readable. 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.
- XML stands for extensible Markup Language
- XML is a markup language like HTML
- XML is designed to store and transport data
- XML is designed to be self-descriptive
Differences between XML and HTML
XML and HTML were designed with different goals:
- XML is designed to carry data emphasizing on what type of data it is.
- HTML is designed to display data emphasizing on how data looks
- XML tags are not predefined like HTML tags.
- HTML is a markup language whereas XML provides a framework for defining markup languages.
- HTML is about displaying data,hence it is static whereas XML is about carrying information,which makes it dynamic.
EXAMPLE :
XML code for a note is given below
HTML code for the note is given below
html
<!DOCTYPE html>
<html>
<h1>Note</h1>
<body>
<p>To:RAJ
<br>
From:RAVI
</p>
<h1>Reminder</h1>
<p>Meeting at 8am</p>
</body>
</html>
OUTPUT:
Note: The output in both the cases is same but while using HTML we have used predefined tags like p tag and h1 tag whereas while using XML we have used self defined tags like "To" tag and "from" tag.
Another Example:
The XML above is quite self-descriptive:
- It has sender information.
- It has receiver information.
- It has a heading.
- It has a message body.
- The tags in the example below are not defined in any XML standard. These tags are "invented" by the author of the XML document.HTML works with predefined tags like p tag, h1 tag, etc.While in XML, the author must define both the tags and the document structure.
Input:
Output:

Basically XML above does not do anything. XML is just information wrapped in tags. Users must require a piece of software to send, receive, store, or display it.
XML makes web development User Friendly : Many computer systems contain data in incompatible formats. Exchanging data between incompatible systems or upgraded systems is a time-consuming task for web developers. Large amounts of data must be converted, and incompatible data is often lost. XML stores data in plain text format. This provides a software- and hardware-independent way of storing, transporting, and sharing data.
XML is Extensible: XML applications will work as expected even if data is edited i.e. added or removed.
Example :The above note is edited into a newer version by adding date tag and hour tag , and by removing the heading tag.
Previous version
New Version
Quiz on HTML and XML
Similar Reads
XML | Tags XML tags are the important features of XML document. It is similar to HTML but XML is more flexible then HTML. It allows to create new tags (user defined tags). The first element of XML document is called root element. The simple XML document contain opening tag and closing tag. The XML tags are cas
2 min read
XML | Syntax Prerequisite: XML | Basics In this article, we are going to discuss XML syntax rule which is used while writing an XML document or an XML application. It is a very simple and straight forward to learn and code. Below is a complete XML document to discuss each component in detail. XML <?xml versi
3 min read
HTML vs XML 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 static page. It is used for displaying the data not to transport the data. HTML is a combination of Hypertext and Markup language. Hypertext defines the link between
3 min read
XML Tutorial XML, or Extensible Markup Language, is a way to structure and organize information in a text format that is easy for computers to read. It uses tags, similar to those in HTML, to define different types of data inside a document. XML allows data to be stored and shared in a consistent and structured
4 min read
XML | Elements The XML elements are the basic building block of the XML document. It is used as a container to store text elements, attributes, media objects etc. Every XML documents contain at least one element whose scopes are delimited by start and end tags or in case of empty elements it is delimited by an emp
2 min read
What are XML Entities ? XML is a way to organize information on the internet. It's like a recipe that tells computers how to understand and use the information. Entities in XML are like ingredients in a recipe. They help you define and reuse parts of your information, making it easier to manage and share. What is XML?XML s
8 min read
What is SGML ? In this article, we are going to learn about SGML.SGML stands for Standard generalized markup language is a Standard generalized markup language that makes use of a superset of extensively used markup languages like HTML and XML. It is used for marking up files and has the gain of now no longer depe
2 min read
XHTML Introduction XHTML or EXtensible HyperText Markup Language is a mix of HTML and XML, very similar to HTML but stricter. It's like a rulebook for creating web pages that browsers easily understand. Unlike HTML, you have to be careful and follow the rules exactly. Most browsers support it. Just think of it as a mo
5 min read
Displaying XML Using XSLT XSLT stands for Extensible Stylesheet Language Transformation. XSLT is used to transform XML document from one form to another form. XSLT uses Xpath to perform matching of nodes to perform these transformation . The result of applying XSLT to XML document could be an another XML document, HTML, text
3 min read