XML

Can you explain why your project needed XML?

Remember XML was meant to exchange data between two entities as you can define your user friendly tags with ease. In real world scenarios XML is meant to exchange data. For instance you have two applications who want to exchange information. But because they work in two complete opposite technologies it’s difficult to do it technically. For instance one application is made in JAVA and the other in .NET. But both languages understand XML so one of the applications will spit XML file which will be consumed and parsed by other applications

You can give a scenario of two applications which More >

What is the difference between XML and HTML?

XML describes data while HTML describes how the data should be displayed. So HTML is about displaying information while XML is about describing information.

What is DTD (Document Type definition)?

It defines how your XML should structure. For instance in the above XML we want to make it compulsory to provide “qty” and “totalcost”, also that these two elements can only contain numeric. So you can define the DTD document and use that DTD document with in that XML.

If XML does not have closing tag will it work?

No, every tag in XML which is opened should have a closing tag. For instance in the top if I remove </discount> tag that XML will not be understood by lot of application.

What is ROOT element in XML?

In our XML sample given previously <invoice></invoice> tag is the root element. Root element is the top most elements for a XML.

What is the version information in XML?

“version” tag shows which version of XML is used.

What is XML?

XML (Extensible markup language) is all about describing data. Below is a XML which describes invoice data.

<?xml version=”1.0″ encoding=”ISO-8859-1″?> <invoice>

<productname>Shoes</productname> <qty>12</qty>

<totalcost>100</totalcost> <discount>10</discount> </invoice>

An XML tag is not something predefined but it is something you have to define according to your needs. For instance in the above example of invoice all tags are defined according to business needs. The XML document is self explanatory, any one can easily understand looking at the XML data what exactly it means.