MCQ Bank
Which of the following statement(s) is/are true about SAX parsing?
- A) SAX parser reports the application program the nature of tokens that the parser has encountered as they occur.
- B) All of the given options.
- C) SAX parser reads an XML document from top to bottom, recognizing the tokens that make up a well-formed XML document.
- D) The application program provides an 'event' handler that must be registered with the parser.
Consider a system (application) which have memory and speed constraint. The application is to process XML documents, sort the contents and mail them to a higher configuration machine for transformation. Which is the best approach?
- A) Use platform native language to process the documents.
- B) DOM and SAX must be used in this context.
- C) Using SAX based approach is the best.
- D) Use DOM based approach.
Converting a Java object into an XML file is called _________.
- A) Marshalling
- B) Transforming
- C) Object Conversion
- D) Un-Marshalling
The cloneNode() method has a parameter :
- A) None of the given
- B) 0 or 1
- C) Yes or No
- D) True or False
Which of the following components of JDOM Parser is used to represents DOM tree?
- A) Element
- B) Text
- C) Attribute
- D) Document
JDOM is an open source java based library, which works with _______.
- A) None of the given options
- B) Both SAX APIs and DOM
- C) SAX APIs
- D) DOM
_________________refers to a means of representing information in an XML document as a business object in computer memory.
- A) DOM binding
- B) None of the given
- C) JAXP binding
- D) XML binding
Which of the following statement(s) is/are true about SAX parsing?
- A) The application program provides an 'event' handler that must be registered with the parser.
- B) All of the given options.
- C) SAX parser reports the application program the nature of tokens that the parser has encountered as they occur.
- D) SAX parser reads an XML document from top to bottom, recognizing the tokens that make up a well-formed XML document.
In SAX parsing, which of the following method is used to read contents?
- A) startDocument()
- B) endElement()
- C) characters()
- D) startElement()
Suppose you need to develop an application that will extract a small portion of the information from a very large XML document. Memory and speed may be constraints. Which of the following approach (method) you will use for development of your application.
- A) Use SAX
- B) Use a schema-based approach.
- C) Extract the necessary information and process using XSLT.
- D) Use DOM
Which method does SAX use for processing XML documents?
- A) DocumentHandler
- B) Event Based
- C) Document
- D) Tree based
Converting an XML content into a Java Object is called _________.
- A) Marshalling
- B) Un-Marshalling
- C) Transforming
- D) Object Conversion
The servlet example can be created by ________ ways.
- A) 4
- B) 5
- C) 3
- D) 2
The service() method checks the ________ request type (GET, POST, PUT, DELETE, etc.) and calls doGet, doPost, doPut, doDelete, etc. methods as appropriate.
- A) HTPP
- B) HTML
- C) HTTP
- D) HTIP
What will you do if two servers are running on the same system with same port number?
- A) Delete the server.xml file of both servers
- B) Assign unique port to each server
- C) Two servers can’t run simultaneously
- D) Servers can run with same port
The destroy() method is called only once at the _________ of the life cycle of a servlet.
- A) end
- B) both start and end
- C) middle
- D) start
The _________ method simply creates or loads some data that will be used throughout the life of the servlet.
- A) servlet()
- B) init()
- C) loads()
- D) creates()
There is/are ServletContext object(s) per web application.
- A) 2
- B) 3
- C) 1
- D) 4
A servlet life cycle can be defined as the entire process from its creation till the ___________.
- A) constructor
- B) destruction
- C) initialization
- D) construction
The servlet calls ____________ method to process a client's request.
- A) init()
- B) service()
- C) start()
- D) request()