Introduction to XML
The eXtensible Markup Language or XML is a markup language, similar to HTML. XML is used for storing and transporting data and is self-descriptive. It is a software- and hardware-independent tool. It is a W3C Recommendation. XML actually does not do anything.
<?xml version="1.0" encoding="UTF-8"?> <note> <to>Sapna</to> <from>Tom</from> <heading>Meeting</heading> <body>At 11 AM on Monday morning.</body> </note>
Output: XML Tree:
The XML though is quite self-descriptive, with sender information, receiver information, a heading, and a message body, but still, it does not do anything and is just information wrapped in tags. A piece of software is required to send, receive, store, or display the XML.
Difference Between XML and HTML:
|Designed to carry data with focus on what data is.||Designed to display data with a focus on how data looks.|
|Tags are not predefined.||Tags are predefined.|
No Predefined Tags:
With no predefined tags, the XML language has its “invented” by the author of the XML document and is not defined in any XML standard. Thus, we need to define both the tags and the document structure in XML. Contrary to this, there are predefined tags like <p>, <h1>, <table>, etc, in HTML.
Even if new data is added or removed, it is expected that most XML applications will work. We just need to be sure that the way XML is constructed, the older version of the application can still work with it.
Data sharing, data transport, platform changes, and data availability are all simplified with XML. With data present in incompatible formats, in many computer systems, the exchange of data between these incompatible or upgraded systems becomes a time-consuming task for web developers. Thus, it is required to convert a large amount of data, and it is also possible that the incompatible data gets lost. By storing data in plain text format, XML facilitates a software- and hardware-independent way of storing, transporting, and sharing data. Along with these features, it is also easy to expand or upgrade to new operating systems, new applications, or new browsers, without losing data, and data can be available to all kinds of “reading machines” like people, computers, voice machines, news feeds, etc., with XML.
In February 1998, XML became a W3C Recommendation.