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 Stands for EXtensible Mark-up Language (XML).
- XML is the Universal format for Structuring Documents and Data on the Web.
- Actually Extensible Mark-up Language is not a mark-up language , but a set of rules for creating a new mark-up language.
- XML is a Subset of Standard Generalized Mark-up Language (SGML).
- SGML specifies the Rules for Creating Mark-up Languages.
- The XML 1.0 was made a World Wide Web Consortium (W3C) recommendation on February 10, 1998.
- A typical XML structure looks Similar to HTML code.
<?xmlversion="1.0"?> <ADDRESS> <NAME>Pritesh Taral</NAME> <STREET>Solapur Road</STREET> <CITY>Pune</CITY> <STATE>Maharashtra</STATE> <ZIP>43256</ZIP> </ADDRESS>
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 ?
- 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
- HTML is used to represent the data contained in the tags. HTML is used to represent web pages
- 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