• +91 9723535972
  • info@interviewmaterial.com

XML Interview Questions and Answers

XML Interview Questions and Answers

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

Answer - 21 : - 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 …: upper- and lower-case must match; thus , , and 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 and (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 - 22 : - How does XML handle white-space  in my documents?

Answer - 22 : - All white-space, including linebreaks, TAB characters, and normal spaces, even between ‘structural’ elements where no text can ever appear, is passed by the parser unchanged to the application (browser, formatter, viewer, converter, etc), identifying the context in which the white-space was found (element content, data content, or mixed content, if this information is available to the parser, eg from a DTD or Schema). This means it is the application's responsibility to decide what to do with such space, not the parser's: * insignificant white-space between structural elements (space which occurs where only element content is allowed, ie between other elements, where text data never occurs) will get passed to the application (in SGML this white-space gets suppressed, which is why you can put all that extra space in HTML documents and not worry about it) * significant white-space (space which occurs within elements which can contain text and markup mixed together, usually mixed content or PCDATA) will still get passed to the application exactly as under SGML. It is the application's responsibility to handle it correctly. The parser must inform the application that white-space has occurred in element content, if it can detect it. (Users of SGML will recognize that this information is not in the ESIS, but it is in the Grove.) My title for Chapter 1. text

Question - 23 : - How can I make my existing HTML files work in XML?

Answer - 23 : - Either convert them to conform to some new document type (with or without a DTD or Schema) and write a stylesheet to go with them; or edit them to conform to XHTML. It is necessary to convert existing HTML files because XML does not permit end-tag minimisation (missing , etc), unquoted attribute values, and a number of other SGML shortcuts which have been normal in most HTML DTDs. However, many HTML authoring tools already produce almost (but not quite) well-formed XML. You may be able to convert HTML to XHTML using the Dave Raggett's HTML Tidy program, which can clean up some of the formatting mess left behind by inadequate HTML editors, and even separate out some of the formatting to a stylesheet, but there is usually still some hand-editing to do.

Question - 24 : - Is there an XML version of HTML?

Answer - 24 : - Yes, the W3C recommends using XHTML which is ‘a reformulation of HTML 4 in XML 1.0’. This specification defines HTML as an XML application, and provides three DTDs corresponding to the ones defined by HTML 4.* (Strict, Transitional, and Frameset). The semantics of the elements and their attributes are as defined in the W3C Recommendation for HTML 4. These semantics provide the foundation for future extensibility of XHTML. Compatibility with existing HTML browsers is possible by following a small set of guidelines (see the W3C site).

Question - 25 : - If XML is just a subset of SGML, can I use XML files directly with existing SGML tools?

Answer - 25 : - Yes, provided you use up-to-date SGML software which knows about the WebSGML Adaptations TC to ISO 8879 (the features needed to support XML, such as the variant form for EMPTY elements; some aspects of the SGML Declaration such as NAMECASE GENERAL NO; multiple attribute token list declarations, etc). An alternative is to use an SGML DTD to let you create a fully-normalised SGML file, but one which does not use empty elements; and then remove the DocType Declaration so it becomes a well-formed DTDless XML file. Most SGML tools now handle XML files well, and provide an option switch between the two standards.

Question - 26 : - What is a markup language?

Answer - 26 : -

Markup languages are designed for presentation of text in different formats, and it can also be used for transporting and storing data. This markup language specifies the code for formatting, layout and style of data .This markup code is called Tag.

HTML and XML are examples of Markup Language.

Question - 27 : - What are the features of XML?

Answer - 27 : -

Main features of XML are:

• Very easy to learn and implement
• XML files are text files, and no editor is required
• Minimal and a limited number of syntax rules in XML
• It is extensible, and it specifies that structural rules of tags

Question - 28 : -
What are the differences between HTML and XML?

Answer - 28 : -

Following are the differences between HTML and XML:

HTML

XML

Markup language used to display data

Markup language used to store data

Case Insensitive

Case sensitive

Designing web pages

Used to transport and store data

Predefined Tags

Custom Tags

Does not Preserve white spaces

Preserve white spaces

Static

Dynamic

Question - 29 : - Which tag is used to find the version of XML and the syntax?

Answer - 29 : -

Declaring the XML version is very important for each XML document and platform needs to be specified in which it is running.


Question - 30 : - What is XML DOM Document?

Answer - 30 : -

XML Document object represents the whole XML document, and it is the root of a document tree. It gives access to entire XML document – Nodes and Elements, and it has its own properties.


NCERT Solutions

 

Share your email for latest updates

Name:
Email:

Our partners