LambdaLabTM
Computer Networks · Class 12 · Web Services · HTML and XML
networksweb services⏱️ 5 min read

HTML vs XML

Both use tags in angle brackets, and both end in “Markup Language”, so they look alike. But they do opposite jobs: one shows data to people, the other describes data for computers.

1The same data, two ways

Showing data vs carrying data

Play it, or step through. Drag sideways to turn.

Press ▶ Play to send the same data two ways.
HTML
<h1>Aman</h1>
<p>Class 12 · Marks: 91</p>
XML
<?xml version="1.0"?>
<result>
  <student>
    <name>Aman</name>
    <class>12</class>
    <marks>91</marks>
  </student>
</result>

2The differences

HTMLXML
Full formHyperText Markup LanguageExtensible Markup Language
PurposeDisplays data — how it looksStores and transports data — what it is
TagsPredefined: only the language's own tagsUser-defined: you create your own tags
CaseNot case-sensitiveCase-sensitive
Closing tagsBrowsers forgive a missing one; some tags have noneEvery tag must be closed, or the document is rejected
CBSE's word for itStaticDynamic
Static and dynamic, in CBSE's marking schemes
CBSE’s answers call HTML “static” and XML “dynamic”. They mean HTML is about fixed presentation of a page, while XML is about data that is carried between programs and changes. Use the words if you like, but the safest differences to write are the first three rows: purpose, tags and case.

3From the board papers

1
Give one difference between XML and HTML.CBSE sample paper 2023-24
1 mark
Show the answer

HTML uses predefined tags and is used to display data; XML lets us define our own tags and is used to store and transport data. (CBSE’s marking scheme also accepts: HTML is not case-sensitive, XML is.)

2
Write two points of difference between XML and HTML.CBSE sample paper 2022-23 · “Differentiate between HTML and XML”, board exam 2022 (Term 2)
2 marks
Show the answer
  1. XML tags are not predefined, they are user-defined; HTML tags are predefined.
  2. XML stores and transports data; HTML is about displaying data.

CBSE’s marking scheme lists these, and static (HTML) vs dynamic (XML).

4Check yourself

Quick Check

A bank sends a list of transactions to another bank's computer so it can process them. Which is the better fit?

Quick Check

Which statement is true?