Java XML Parsers Quiz

Java XML Parsers Quiz

 



Java XML Parsers Quiz contain set of 10 MCQ questions for Java XML Parsers MCQ which will help you to clear beginner level quiz.



1.      Which Java provided XML parser parses the document by loading the complete contents of the document and creating its complete hierarchical tree in memory?

  1. SAX Parser
  2. StAX Parser
  3. Dom Parser
  4. XPath Parser

2.      Which Java provided XML parser parses the document on event based triggers and does not load the complete document into the memory?

  1. SAX Parser
  2. StAX Parser
  3. Dom Parser
  4. XPath Parser

3.      Which DOM method returns the root element of the document?

  1. Document.getDocumentElement()
  2. Node.getFirstChild()
  3. Document.getRoot()
  4. None of these

4.      Which of the following methods create a Document Builder instance?

  1. DocumentBuilderFactory.createDocumentBuilder()
  2. DocumentBuilderFactory.newDocumentBuilder()
  3. Document.createDocumentBuilder()
  4. Document.newDocumentBuilder()

5.      Which Interface specifies the callback methods that the SAX parser uses to notify an application program of the components of the XML document that it has seen?

  1. ContentHandler
  2. TransformerHandler
  3. SAXHandler
  4. XMLReader

6.      What is the Superinterface of Interface “Document”?

  1. XMLReader
  2. ContentHandler
  3. DocumentBuilder
  4. Node

7.      Which of the following class of StAX parser specifies methods for creating an event?

  1. XMLEventReader
  2. XMLEventWriter
  3. Both of the above.
  4. None of the above.

8.      The method Document.importNode(Node importedNode,   boolean deep) imports a node from another document to current document. Which of the following is false regarding this method?

  1. The source node from the original document is not altered or removed
  2. This method creates a new copy of the source node
  3. DocumentType nodes can be imported.
  4. Entity nodes can be imported

9.      Which method is used to build JDOM document from the xml source?

  1. SAXBuilder.build(xmlSource)
  2. Document.build(xmlSource)
  3. Document.newDocumentBuilder(xmlSource)
  4. None of these

10.  What SAX stands for?

  1. Solve Analyze XML
  2. Simple API for XML
  3. Streaming API for XML
  4. Standard API for XML

11.  Which of the following component represent base datatype of the DOM in DOM Parsing?

  1. Node
  2. Element
  3. Attr
  4. Document