MCQ Bank
Which of the following statement is correct about Marshalling?
- A) Used to write data in XML documents
- B) Used to read data from XML documents
- C) None of the given
- D) Can be used for both writing/reading purposes
Which of the following method get called at the beginning of a document in SAX parsing?
- A) startDocument()
- B) None of the given options.
- C) documentStart()
- D) initDocument()
Methods such as startDocument, endDocument, startElement, and endElement are invoked by ____________.
- A) Error Handler
- B) Content Handler
- C) Default Handler
- D) DTD Handler
Which of the following methods is used in JDOM Parser to get all the direct child nodes of an element?
- A) Element.getChildren()
- B) Node.getChild()
- C) Node.getChildren()
- D) Document.getChildren()
A ______________ implements the ContentHandler, ErrorHandler, DTDHandler, and EntityResolver interfaces.
- A) Content Handler
- B) Default Handler
- C) Error Handler
- D) DTD Handler
Which method does SAX use for processing XML documents?
- A) Event Based
- B) DocumentHandler
- C) Document
- D) Tree Based
By default, the Marshaller uses __________ encoding when generating XML data.
- A) UTF-16
- B) UTF-32
- C) None of the given
- D) UTF-8
The SAX based parser is most likely to be used in which of the following scenarios?
i) You want to process the document in a sequential order only.
ii) The documents is very large.
iii) When there is no need to validate XML documents.
iv) The parser implements only SAX based approach.
- A) None of the given options.
- B) i and ii
- C) iii and iv
- D) ii and iii
Which of the following statement is correct about Unmarshalling?
- A) Can be used for both writing/reading purposes
- B) None of the given
- C) Used to read data from XML documents
- D) Used to write data in XML documents
Which of the following method get called at the end of a document in SAX parsing?
- A) finalizeDocument()
- B) None of the given options.
- C) endDocument()
- D) documentEnded()
Which of the following is much more memory intensive?
- A) SAX
- B) JAXP
- C) DOM
- D) StAX
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) Extract the necessary information and process using XSLT.
- B) Use a schema-based approach.
- C) Use SAX
- D) Use DOM
In ________ we mean to Convert a Java object into a XML file.
- A) Marshalling
- B) Annotations
- C) SAX
- D) Unmarshalling
Which of the following method is used to create copy of a specified node?
- A) cloneNode()
- B) duplicateNode()
- C) copyNode()
- D) None of the given
Which of the following provides metadata on packages, classes, fields and methods in Java code generated by the JAXB schema compiler?
- A) Unmarshalling
- B) Marshalling
- C) Annotations
- D) XML binding
In SAX parsing, which of the following method is used to read contents?
- A) characters()
- B) endElement()
- C) startDocument()
- D) startElement()
Which of the followings is/are feature(s) of JDOM?
- A) It is straight forward and optimized
- B) It is a lightweight and fast
- C) All of the given options.
- D) It is memory efficient.
If the attribute already exists, the setAttribute() method will _______ the existing value.
- A) Duplicate
- B) Overwrite
- C) None of the given
- D) Not overwrite
insertBefore() method will insert a node before a specified ______ node.
- A) parent
- B) none of the given options
- C) text
- D) child
Which of the following is true about JDOM Parser?
- A) JDOM is an open source, java based library to parse XML document
- B) None of the above
- C) Both of the above
- D) JDOM is typically java developer friendly API