Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

Introduction to XML - What is XML?


May 27, 2021 XML


Table of contents


Introduction to XML

This section will continue to introduce you to some of the knowledge points about XML, which is the basis for learning about XML!

XML is designed to transfer and store data.

HTML is designed to display data.

Tip: XML is an extensable markup language, and HTML is a hyper-text tag language.


The basics that should be mastered

Before you can continue, you need to have a basic understanding of the following:

  • Html
  • Javascript

If you would like to learn about these projects first, please visit these tutorials on our home page.


What is XML?

  • XML refers to the extensible markup language (EXtensible Markup Language).
  • XML is a tag language that looks a lot like HTML.
  • XML is designed to transfer data, not display it.
  • XML tags are not predefined. You need to define your own labels.
  • XML is designed to be self-descriptive.
  • XML is the recommended standard for W3C.

The difference between XML and HTML

XML is not an alternative to HTML.

XML and HTML are designed for different purposes:

  • XML is designed to transfer and store data, focusing on the content of the data.
  • HTML is designed to display data, with the focus on the appearance of the data.

HTML is designed to display information, while XML is designed to transmit information.


XML doesn't do anything

It may be hard to understand, but XML doesn't do anything. XML is designed to structure, store, and transmit information.

The following example is Jani's note to Tove, stored as XML:

<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>

The note above is self-descriptive. It contains information about the sender and recipient, with both the title and the message body.

However, this XML document still doesn't do anything. I t's just pure information wrapped in an XML label. We need to write software or programs to transmit, receive, and display this document.


XML allows you to invent your own labels

The labels in the above instances are not defined in any XML standard (e.g., slt;to> and slt;from.gt;). These tags were invented by the creators of XML documents.

This is because the XML language does not have predefined labels.

Labels used in HTML are predefined. HTML documents can only use labels that are defined in html standards (e.g., .lt;p.gt;, .lt;h1?gt; and so on).

XML allows creators to define their own labels and their own document structure.


XML is not an alternative to HTML

XML complements HTML.

It is important to understand that XML does not replace HTML. In most Web applications, XML is used to transfer data, while HTML is used to format and display data.

The best description of XML is:

XML is a software- and hardware-independent information transfer tool.


XML is the recommended standard for W3C

XML became the recommended standard for W3C on February 10, 1998.

To learn more about W3C XML activities, visit our W3C tutorial.


XML is everywhere

Currently, XML plays no less important role in the Web than HTML, which has been the cornerstone of the Web.

XML is the most common tool for data transfer between applications.


Related tutorials

HTML tutorial