What is HTML and XML?
HTML
HTML is short for HyperText Markup Language and is the basis for website building. It defines the structure of a website. It is often assisted by technologies such as CSS and JavaScript.
Here is an example of HTML
<!DOCTYPE html>
<html>
<head>
<title>HTML vs XML</title>
</head>
<body>
<h1>My First Heading</h1>
<p>My first paragraph.</p>
</body>
</html>
HTML was Developed by: WHATWG and W3C (World Wide Web Consortium).
XML
XML is short for Extensible Markup Language and is a file format for storing, transmitting, and reconstructing arbitrary data. XML is a markup language much like HTML. It was designed to store and transport data.
Here is an example of XML
<note>
<to>HTML</to>
<from>XML</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>
XML was Developed by: W3C (World Wide Web Consortium).
So what's the Difference?
XML was designed to carry data - with a focus on what data is, while HTML was designed to display data - with a focus on how data looks.
HTML works with predefined tags like <p>
, <h1>
, <table>
, etc. With XML, the author must define both the tags and the document structure.
Sources
W3Schools
Top comments (0)