what is xml ?

XML stands for Extensible Markup Language.It was designed to store and transport data, making it a versatile tool for exchanging information between different systems. Think of it as a filing system for information, where everything has a designated place and label.XML is designed to transport and store data efficiently. It’s widely used for various purposes, including.

  • Exchanging data between different software applications
  • Configuring settings in programs
  • Storing product information in e-commerce platforms
  • Sharing scientific data

Key Features of XML:

  • Self-describing: XML defines its own structure using tags, making it easy to understand the data even without prior knowledge.
  • Platform-independent: XML files can be opened and processed on different operating systems without any issues.
  • Extensible: You can create your own tags to represent any kind of data, making it highly flexible.

Structure of an XML Document:-

XML document consists of:

  • ags: These define the different elements of the data. Tags are enclosed in angle brackets (<>).
  • Attributes: These provide additional information about an element, placed within the opening tag.
  • Content: This is the actual data stored within the tags.

Example :-

<book>
  <title>The Lord of the Rings</title>
  <author>J. R. R. Tolkien</author>
  <year>1954</year>
</book>

XML Usage

list of XML usage says it all

  • XML can work behind the scene to simplify the creation of HTML documents for large web sites.
  • XML can be used to exchange the information between organizations and systems.
  • XML can be used for offloading and reloading of databases.
  • XML can be used to store and arrange the data, which can customize your data handling needs.
  • XML can easily be merged with style sheets to create almost any desired output.Virtually, any type of data can be expressed as an XML document.

The Difference between XML and HTML

XML and HTML were designed with different goals

  • XML was designed to carry data – with focus on what data is
  • HTML was designed to display data – with focus on how data looks
  • XML tags are not predefined like HTML tags
  • XML documents form a tree structure that starts at “the root” and branches to “the leaves .

XML Syntax

Following is a complete XML document:-

<?xml version="1.0"?>
<contact_info>
<name>Rajesh</name>
<company>TCS</company>
<phone>9333332354</phone>
</contact_info>

You can notice there are two kinds of information in the above example.

  • markup, like and
  • the text, like Rajesh etc.

The following diagram depicts the syntax rules to write different types of markup and text in an XML document.

Leave a Comment