What is XML? Discuss two advantages and disadvantages of using it, and support your ideas with relevant examples.
Answer:
XML (Extensible Markup Language):
XML stands for Extensible Markup Language. It is a text-based markup language derived from Standard Generalized Markup Language (SGML).
XML tags identify the data and are used to store and organize the data, rather than specifying how to display it like HTML tags, which are used to display the data.
XML was designed to be self-descriptive.
XML is a W3C Recommendation.
Advantages of XML:
1) XML separates data from HTML:
If you need to display dynamic data in your HTML document, it will take a lot of work to edit the HTML each time the data changes.
With XML, data can be stored in separate XML files. This way you can focus on using HTML/CSS for display and layout, and be sure that changes in the underlying data will not require any changes to the HTML.
With a few lines of JavaScript code, you can read an external XML file and update the data content of your web page.
2) XML simplifies Platform change:
Upgrading to new systems (hardware or software platforms), is always time consuming. Large amounts of data must be converted and incompatible data is often lost.
XML data is stored in text format. This makes it easier to expand or upgrade to new operating systems, new applications, or new browsers, without losing data.
Disadvantages of XML:
1) Redundancy:
XML syntax is redundant or large relative to binary representations of similar data, especially with tabular data. The redundancy may affect application efficiency through higher storage, transmission and processing costs.
2) Inefficient:
XML is relatively inefficient compare to other storage algorithms. This is due to use of XML tags which require extra storage or bandwidth. Storage of binary data such as image data is also inefficient. Storage is done using Base 64 encoding which takes 4 bytes to store 3 bytes of binary data. Hence it consumes more storage/bandwidth.
Please give thumbsup, if you like it. Thanks.
What is XML? Discuss two advantages and disadvantages of using it, and support your ideas with...