XML Introduction



In this tutorial we will be introducing XML which is designed to describe data unlike HTML which was designed to display data.

Re-commanded Article : HTML Introduction

XML Introduction

  1. XML Stands for EXtensible Mark-up Language (XML).
  2. XML is the Universal format for Structuring Documents and Data on the Web.
  3. Actually Extensible Mark-up Language is not a mark-up language , but a set of rules for creating a new mark-up language.
  4. XML is a Subset of Standard Generalized Mark-up Language (SGML).
  5. SGML specifies the Rules for Creating Mark-up Languages.
  6. The XML 1.0 was made a World Wide Web Consortium (W3C) recommendation on February 10, 1998.
  7. A typical XML structure looks Similar to HTML code.

xmlevolution

XML Example

<?xmlversion="1.0"?>
<ADDRESS>
     <NAME>Pritesh Taral</NAME> 
     <STREET>Solapur Road</STREET>
     <CITY>Pune</CITY>
     <STATE>Maharashtra</STATE>
     <ZIP>43256</ZIP>  
</ADDRESS>

Explanation :

As shown in the above example, we can see XML structure is like HTML structure. XML is represented using hierarchical or tree like structure.

<addresslist>
<address>
     <name>pritesh taral</name> 
     <street>solapur road</street>
     <city>pune</city>
     <state>maharashtra</state>
     <zip>43256</zip>  
</address>
<address>
     <name>suraj taral</name> 
     <street>solapur road</street>
     <city>pune</city>
     <state>maharashtra</state>
     <zip>43256</zip>  
</address>
</addresslist>

XML tree consists of the tags like HTML but tags defined are not pre-defined. Some of the pre-defined tags used in HTML are strong,body,head,title.

XML is not used to render web pages , It is used to transfer and represent data using tags. In the above XML file we are transferring address information of two persons.

<address>
     <name>pritesh taral</name> 
     <street>solapur road</street>
     <city>pune</city>
     <state>maharashtra</state>
     <zip>43256</zip>  
</address>

Above tag of XML clearly tells us that we are transferring address of person “pritesh taral” who is living near solapur road in pune, maharashtra having pin 43256

XML is replacement of HTML ?

  1. One thing we must keep in our mind that XML is not a replacement for HTML. We can treat it as complementary language for HTML
  2. HTML is used to represent the data contained in the tags. HTML is used to represent web pages
  3. XML is used to carry information. More clear answer of this question is explained beautifully here

In this XML Introduction topic we have learnt about the basic of XML. In the next chapter we will be learning examples of XML