MENU

Chapter 8 Introduction to XML Solutions

Question - 11 : - List the important points to create an XML document.

Answer - 11 : -

The points while creating an XML documents are as follows:

  1. XML documents must have starting and closing tags.
  2. XML tags are case sensitive.
  3. XML elements must be properly nested.
  4. XML documents must have one root element.
  5. The values of XML attributes must be enclosed in double quotes.

Question - 12 : - Explain the utility of comments in XML.

Answer - 12 : -

A comment is a note or information that appears in the code of an XML document to help you understand the code better.

Comments are not displayed in the output. They are not part of the program and therefore, are not parsed by the XML parser.

Question - 13 : -
State whether the following XML document is well-formed or not
Mapoj
Ankur

Answer - 13 : - The preceding XML document is not well-formed because it contains two root elements. An XML document contains only one root element.

Question - 14 : - Name some languages, which are derived from XML.

Answer - 14 : -

Some languages are as follows:

  1. Ink Markup Language (InkML)
  2. Business Narrative Markup Language (BNML)
  3. Financial Product Markup Language (FPML)
  4. Virtual Human Markup Language (VHML) .
  5. Architecture Description Markup Language (ADML)
  6. Artificial Intelligence Markup Language (AIML)
  7. Chess Markup Language (ChessML) etc.

Question - 15 : - Define prolog and data instance.

Answer - 15 : - The prolog is a preface or introduction to XML document. It can contain upto five optional components. The grammar structure of the XML document is defined under prolog. The data instance consists of real data and its description through elements. It is also known as body of XML document.

Question - 16 : - Create XML markup to represent a message sent on 7 June, 2014 to Amit and Saurabh by Mohit. The message is “Submitted Successfully”.

Answer - 16 : -

Mohit
Amit
Saurabh
Submitted Successfully

Question - 17 : - What do you mean by Processing Instructions (PI)?

Answer - 17 : - PI can be used to pass information to applications in such a way that escapes most XML rules. Its main use is of linking to an XML stylesheet in the prolog of an XML document. Processing instructions do not have to follow much internal syntax, it can include markup characters without escaping them and can appear anywhere in the document.


Question - 18 : -
Explain two softwares which are used to validate XML documents.

Answer - 18 : -

Two important software that validate or process XML documents are as follows:

1. XML Validator are the software packages that check the XML document as per the specified DTD and give you feedback about the document.
Some XML validators are as follows:
(a) W3C XML Validator
(b) Tidy
(c) XML. com’s
(d) Brown University
2. XML Parsers are the software packages, which are part of bigger applications that provide XML support.
The role of an XML parser is to dissect a valid XML document to obtain actual data from the XML document. Some XML parsers are as follows:
(a) SAXfSimple API for XML)
(b) Expat
(c) LT-XML etc.

Question - 19 : -
Write an XML document that marks up the following data:
All these must be rendered. Use attribute to make the data more informative.

Answer - 19 : -

Raj Kumar
Delhi
Pankaj
Mumbai
Rahul Sharma
Delhi
Praveen
Noida

Question - 20 : - Compare XML with similar type of other languages.

Answer - 20 : -

1. Comparing XML andSGML

XML

SGML

XML is a markup language.

SGML is a meta language used to define and describe generic markup language.

It does not include complex and optional features of SGML.

It is complex and requires overheads to use it.

XML allows creation of new  tags to describe and present  your data.

It is an ISO standard for specifying a set of tags,

XML allows data validation.

SGML does not allow data validation.

It describes the data and transfers data between applications.

It allows you to define and create platform-independent files.

2. Comparing HTML andXML

HTML

XML

HTML tags are predefined.

XML tags are not predefined.

HTML is case insensitive.

XML is case sensitive.

HTML is markup language that creates the form and appearance of the Web page.

XML is neither a programming nor a presentation language.

3. Comparing EDI andXML

EDI

XML

EDI (Electronic Data Interchange) is a collection of standards, formats and file layout.

XML is an emerging standard designed to simplify Web-based E-Commerce transactions between computer application.

EDI enables highly secure document exchanges.

XML document typically needs to be encrypted to maintain security level.

EDI documents are sent via private and relatively expensive Value Added Networks (VANs).

XML documents are generally sent via the Internet.

EDI does not processes low transaction values.

XML processes relatively low transaction values.

EDI allows companies to exchange electronic documents quickly between their trading partners.

XML allows you to create custom tags to present your document in a structured format.

 

Free - Previous Years Question Papers
Any questions? Ask us!
×