Skip to main content

All about XML


What is XML?



I've published several posts on HTML. But this is my first post on XML that stands for eXensible Markup Language. Before starting the main discussion, I'd like to inform you that I've collected information about XML from w3schools. I was just surfing that site and suddenly my eyes go to the XML tutorials. Then I decided to write something on XML.


In fact, today's post is a knowledge base article. From this post, you will know about - what is XML. This post will not teach you how to prepare XML files. So, don't be confused.


Okay let's start - XML doesn't do anything! Confused? But there is no way to be confused actually when you will know that XML is nothing except some texts stored in tags.

  • XML - EXtensible Markup Language.

  • It's used to store and transport data.

  • Unlike HTML, XML is only used to store and transport data, not to display.

  • Unlike HTML, here you can define your own tags.

  • XML is simply a complement to HTML.


How Does XML Differ from HTML?

A Good question to reply. When you browse a site through internet, you just see structured texts, images, pages etc. You never see the codes behind those beautiful sites. But your browser has to interpret those pages using HTML. Any browser uses HTML to display websites.

HTML is used to display data. In contrast, XML is used to store and transport data. You can define your own tags in XML. But you can't do the same thing in HTML. Because HTML doesn't allow you to create something by yourself. It has some specific rules.
If you wanna learn about XML, you should have a basic knowledge in HTML and JavaScript.


A Little Example:

The following example may provide you a true understanding of an XML document. This is a piece of message. It has a sender, a receiver, a subject and a body. But the information is only wrapped in tags. You must use a media to send the information somewhere.

<Message>
<to>Adnan</to>
<from>Munna</from>
<Subject>Reminder</Subject>
<body>Never forget to inform me about AdSense Letter</body>
</Message>


The message above is absolutely self descriptive in that sense that some of the tags are invented by myself! The tags - <Message>, <Subject> are my own creation! In XML, you're allowed to create your own tags. Surprisingly, XML language has NO predefined tags!  XML allows author to define his/ her own tags and document structure.



Where you are, You with the XML!

XML became a W3C Recommendation on February 10, 1998. It is as important as HTML. XML is the most common tool for the transmission of data among all sorts of applications.  
  

Stay with Marks PC Solution to get more interesting IT topics!


Comments

  1. Good to see my name here!

    But the title says, all about XML. Well, to be honest, the post does not explain all the things about xml. It just defines it. XML has many rules. In fact, it is strictly structured. Even a single disposition of a character can break the whole XML code. There are 2 important rules for XML which you should mention.

    1. Every tag that starts must have an ending tag. (<tag></tag>) But if it doesn't contain anything inside it, it can go like this: <tag /> (without the ending tag.)

    2. Every attribute must have values enclosed with double quotes. Early HTML standards did not specify this. But XHTML (or HTML with XML standards) takes this rule seriously.
    So, <input type="checkbox" checked > is invalid.
    But, <input type="checkbox" checked="checked" /> is valid.

    These 2 rules are the gist of XHTML.

    You are right that XML does not do anything by itself. It is just data. The reason behind inventing this complex data structure is that it is ideal for storing hierarchical data. For example,

    <family>

    <parents>
    <parent name="Shameem" role="Father" />
    <parent name="Khaleda" role="Mother" />
    </parents>

    <children>
    <child name="Khalid" role="Son" />
    <child name="Tarik" role="Son" />
    <child name="Tanvir" role="Son" />
    <child name="Adnan" role="Son" />
    </children>
    </family>

    Here you can see that the family structure has been presented in a hierarchical manner. The tags are there. So if you want to add another parent, for example, a grand parent, it is easier. And from the single code you can understand the hierarchical relation among the data. Examples would make it clearer my friend.

    ReplyDelete

Post a Comment

Popular posts from this blog

GTA San Andreas Cheat Code (PDF)

After Vice City, San Andreas is the most popular game released by Grand Theft Auto (GTA). Usually GTA releases role playing game. San Andreas is such a game where you can act like a person. You can do everything. You have to take part in missions and complete them.  To make your missions easier, there are lots of cheat codes. If you can properly apply these codes, the tough parts of the game will be easier. Cheat codes are somewhat like keyboard shortcuts of computer programs.  I've shared 63 cheat codes below. There were more cheat codes in my collection, but I've omitted the less important cheats. Effects or result of the cheats are on the left side, and the codes are on the right side.  You can copy the following codes in your PC. And for your convenience, I've also uploaded a PDF file of these codes. You will find the download link at the bottom.  Effect Cheat Code Adrenaline Mode MUNASEF All Cars Explode ALL...

Joining Texts from Multiple Cells in Excel

  Programs like MS Excel is full of functions. There are many useful functions that we don't use or we don't know about. One of them is CONCATENATE. It means joining or linking. With this function you can join texts from multiple cells. Let's see how . . . Suppose you're working in an Excel Worksheet where you need to combine texts from different cells. I'm gonna show you an example. Let's consider the image below -    What do you see ? I've imputed First Name and Last Name. In Full Name column I've used the formula i.e. CONCATENATE. And in the last column I've added Mr. with the full name.    So how do you use this formula ? Here it is -  =CONCATENATE(A2," ",B2) Observe it carefully. You can add more than 02 cells with this functions. Here I've just used 02 cells. You may think what is this " " for ? You may notice that there is a space between the two i.e. " & ".  If you don't use " " then you...

Running Total/ Cumulative Sum in Excel

  Hey Guys! You should have noticed that I'm writing on MS Excel for last few days! To be honest I'm trying to learn some simple and useful tricks of Excel. And I'm also trying to share my knowledge with you. In this post I've come with such a little trick which maybe very useful if you face such situation. Let's begin . . .    Running Total/ Cumulative Sum It means the summation of numbers in a list and it will be updated each time when a number is added or changes. Look at the image below -    Look at the image. There are two columns with numbers. The first one is simply the number list. But the 2nd one is the summation of the list. Each time a new number is added to the first column the second one shows the summation. How to do this?  It's not a magic. Very simple sum formula is used to perform this task. But there is a little trick. You just need to lock the first cell and then every time it will update the running total list.  Here is my list. Sim...