XML Introduction
- Previous Page XML Tutorial
- Next Page XML Usage
XML is a tool independent of software and hardware, used for storing and transmitting data.
What is XML?
- XML stands for Extensible Markup Language (EXtensible Markup Language)
- XML is a markup language, similar to HTML
- XML is intended for storing and transmitting data
- XML is designed to be self-descriptive
- XML is a W3C Recommended Standard
XML with no action
It may be a bit difficult to understand, but XML does nothing.
XML is designed for structuring, storing, and transmitting information.
Below is the note written by John to George, stored as XML:
<note> <to>George</to> <from>John</from> <heading>Reminder</heading> <body>Don't forget the meeting!</body> </note>
The XML is very self-descriptive:
- It contains sender information
- It contains recipient information
- It has a title
- It has a message body
However, this XML document does nothing. It is just pure information wrapped in XML tags.
We need to write software or programs to transmit, receive, and display this document.
Note
To: George
From: John
Reminder
Don't forget the meeting!
The difference between XML and HTML
The design goals of XML and HTML are different:
- XML is designed to carry data - focusing on what the data is
- HTML is designed to display data - focusing on the appearance of the data
- XML tags are not predefined like HTML tags
XML does not use predefined tags
The XML language has no predefined tags.
The tags in the example (such as <to> and <from>) are not defined in any XML standard. These tags are 'invented' by the author of the XML document.
HTML uses predefined tags such as <p>, <h1>, <table>, etc.
For XML, the author must define tags and document structure.
XML is extensible
Even if new data is added (or deleted), most XML applications will work as expected.
Suppose an application is designed to display the original version of note.xml (<to> <from> <heading> <body>)).
Then imagine a newer version of note.xml that adds <date> and <hour> elements and removes <heading>.
After XML is reconstructed in this way, the old version of the application can work normally:
<note> <date>2023-01-10</date> <hour>09:30</hour> <to>George</to> <from>John</from> <body>Don't forget the meeting!</body> </note>
New version
Note
To: George
From: John
Date: 2023-01-10 09:30
Don't forget the meeting!
XML - simplifies everything
- XML simplifies data sharing
- XML simplifies data transmission
- XML simplifies platform changes
- XML simplifies data availability
Many computer systems contain data that is not compatible with each other. For web developers, exchanging data between incompatible systems (or upgraded systems) is a time-consuming task. For this reason, a large amount of data must be converted, and these incompatible data are also prone to loss.
XML stores data in plain text format. This provides a way to store, transmit, and share data independently of software and hardware.
XML can also be more easily expanded or upgraded to new operating systems, new applications, or new browsers without losing data.
Through XML, data can be used by various 'reading machines', such as people, computers, voice machines, news feeds, and more.
XML is a W3C Recommended Standard
As early as February 1998, XML became a W3C recommended standard.
- Previous Page XML Tutorial
- Next Page XML Usage