• +91 9971497814
  • info@interviewmaterial.com

Computer Interview Questions Answers

XML Interview Questions Answers

Question - 21 : - Do I have to know HTML or SGML before I learn XML?

Answer - 21 : - No, although it's useful because a lot of XML terminology and practice derives from two decades' experience of SGML. Be aware that ‘knowing HTML’ is not the same as ‘understanding SGML’. Although HTML was written as an SGML application, browsers ignore most of it (which is why so many useful things don't work), so just because something is done a certain way in HTML browsers does not mean it's correct, least of all in XML.

Question - 22 : - Which parts of an XML document are case-sensitive?

Answer - 22 : - All of it, both markup and text. This is significantly different from HTML and most other SGML applications. It was done to allow markup in non-Latin-alphabet languages, and to obviate problems with case-folding in writing systems which are caseless. * Element type names are case-sensitive: you must follow whatever combination of upper- or lower-case you use to define them (either by first usage or in a DTD or Schema). So you can't say <BODY>…</body>: upper- and lower-case must match; thus <Img/>, <IMG/>, and <img/> are three different element types; * For well-formed XML documents with no DTD, the first occurrence of an element type name defines the casing; * Attribute names are also case-sensitive, for example the two width attributes in <PIC width="7in"/> and <PIC WIDTH="6in"/> (if they occurred in the same file) are separate attributes, because of the different case of width and WIDTH; * Attribute values are also case-sensitive. CDATA values (eg Url="MyFile.SGML") always have been, but NAME types (ID and IDREF attributes, and token list attributes) are now case-sensitive as well; * All general and parameter entity names (eg Á), and your data content (text), are case-sensitive as always.

Question - 23 : - Give some examples of XML DTDs or schemas that you have worked with.

Answer - 23 : - Although XML does not require data to be validated against a DTD, many of the benefits of using the technology are derived from being able to validate XML documents against business or technical architecture rules. Polling for the list of DTDs that developers have worked with provides insight to their general exposure to the technology. The ideal candidate will have knowledge of several of the commonly used DTDs such as FpML, DocBook, HRML, and RDF, as well as experience designing a custom DTD for a particular project where no standard existed.

Question - 24 : - What does an XML document actually look like (inside)?

Answer - 24 : - The basic structure of XML is similar to other applications of SGML, including HTML. The basic components can be seen in the following examples. An XML document starts with a Prolog: 1. The XML Declaration which specifies that this is an XML document; 2. Optionally a Document Type Declaration which identifies the type of document and says where the Document Type Description (DTD) is stored; The Prolog is followed by the document instance: 1. A root element, which is the outermost (top level) element (start-tag plus end-tag) which encloses everything else: in the examples below the root elements are conversation and titlepage; 2. A structured mix of descriptive or prescriptive elements enclosing the character data content (text), and optionally any attributes (‘name=value’ pairs) inside some start-tags. XML documents can be very simple, with straightforward nested markup of your own design: <?xml version="1.0" standalone="yes"?> <conversation><br> <greeting>Hello, world!</greeting> <response>Stop the planet, I want to get off!</response> </conversation> Or they can be more complicated, with a Schema or question C.11, Document Type Description (DTD) or internal subset (local DTD changes in [square brackets]), and an arbitrarily complex nested structure: <?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE titlepage SYSTEM "http://www.google.bar/dtds/typo.dtd" [<!ENTITY % active.links "INCLUDE">]> <titlepage id="BG12273624"> <white-space type="vertical" amount="36"/> <title font="Baskerville" alignment="centered" size="24/30">Hello, world!</title> <white-space type="vertical" amount="12"/> <!-- In some copies the following decoration is hand-colored, presumably by the author --> <image location="http://www.google.bar/fleuron.eps" type="URI" alignment="centered"/> <white-space type="vertical" amount="24"/> <author font="Baskerville" size=&quo

Question - 25 : - Why is XML such an important development?

Answer - 25 : - 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 question A.4, 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.

Computer Contributors

krishan
Rajeev Katiyar
Yes Baroda

Share your email for latest updates

Name:
Email:

Our partners