XML Interview Questions and Answers
Ques 1. What is XML?
Ans. XML is the Extensible Markup Language. It improves the functionality of the Web by letting you identify your information in a more accurate, flexible, and adaptable way. It is extensible because it is not a fixed format like HTML (which is a single, predefined markup language). Instead, XML is actually a metalanguage a language for describing other languages which lets you design your own markup languages for limitless different types of documents. XML can do this because it's written in SGML, the international standard metalanguage for text document markup (ISO 8879).
Ques 2. What is a markup language?Ans. A markup language is a set of words and symbols for describing the identity of pieces of a document (for example ?this is a paragraph?, ?this is a heading?, ?this is a list?, ?this is the caption of this figure?, etc). Programs can use this with a stylesheet to create output for screen, print, audio, video, Braille, etc. Some markup languages (eg those used in wordprocessors) only describe appearances (?this is italics?, ?this is bold?), but this method can only be used for display, and is not normally re-usable for anything else.
Ques 3. Where should I use XML?Ans. Its goal is to enable generic SGML to be served, received, and processed on the Web in the way that is now possible with HTML. XML has been designed for ease of implementation and for interoperability with both SGML and HTML. Despite early attempts, browsers never allowed other SGML, only HTML (although there were plugins), and they allowed it (even encouraged it) to be corrupted or broken, which held development back for over a decade by making it impossible to program for it reliably. XML fixes that by making it compulsory to stick to the rules, and by making the rules much simpler than SGML. But XML is not just for Web pages: in fact it's very rarely used for Web pages on its own because browsers still don't provide reliable support for formatting and transforming it. Common uses for XML include:
Information identification because you can define your own markup, you can define meaningful names for all your information items. Information storage because XML is portable and non-proprietary, it can be used to store textual information across any platform. Because it is backed by an international standard, it will remain accessible and processable as a data format.
Ques 4. Why is XML such an important development?Ans. It removes two constraints which were holding back Web developments: 1. dependence on a single, inflexible document type (HTML) which was being much abused for tasks it was never designed for; 2. the complexity of full SGML, whose syntax allows many powerful but hard-to-program options. XML allows the flexible development of user-defined document types. It provides a robust, non-proprietary, persistent, and verifiable file format for the storage and transmission of text and data both on and off the Web; and it removes the more complex options of SGML, making it easier to program for.
Ques 5. Describe the differences between XML and HTML?Ans. It's amazing how many developers claim to be proficient programming with XML, yet do not understand the basic differences between XML and HTML. Anyone with a fundamental grasp of XML should be able describe some of the main differences outlined in the table below.
Differences Between XML and HTML
► User definable tags
► Content driven
► End tags required for well formed documents
► Quotes required around attributes values
► Slash required in empty tags
► Defined set of tags designed for web display
► Format driven
► End tags not required
► Quotes not required
► Slash not required
Most helpful rated by users: