- Java XML Tutorial
- Java XML Home
- Java XML Overview
- Java XML Parsers
- Java DOM Parser
- Java DOM Parser
- Parse XML Document
- Query XML Document
- Create XML Document
- Modify XML Document
- Java SAX Parser
- Java SAX Parser
- Parse XML Document
- Query XML Document
- Create XML Document
- Modify XML Document
- JDOM XML Parser
- JDOM XML Parser
- Parse XML Document
- Query XML Document
- Create XML Document
- Modify XML Document
- Java StAX Parser
- Java StAX Parser
- Parse XML Document
- Query XML Document
- Create XML Document
- Modify XML Document
- Java XPath Parser
- Java XPath Parser
- Parse XML Document
- Query XML Document
- Create XML Document
- Modify XML Document
- Java DOM4J Parser
- Java DOM4J Parser
- Parse XML Document
- Query XML Document
- Create XML Document
- Modify XML Document
- Java XML Useful Resources
- Java XML - Questions and Answers
- Java XML - Quick Guide
- Java XML - Useful Resources
- Java XML - Discussion
Java XML Online Quiz
Following quiz provides Multiple Choice Questions (MCQs) related to Java XML Framework. You will have to read all the given answers and click over the correct answer. If you are not sure about the answer then you can check the answer using Show Answer button. You can use Next Quiz button to check new set of questions in the quiz.
Q 1 - Which of the following component represent base datatype of the DOM in DOM Parsing?
Answer : A
Explaination
Node represents the base datatype of the DOM.
Q 2 - Which of the following is true about SAX parsing?
C - The application program provides an 'event' handler that must be registered with the parser.
Answer : D
Explaination
All of the above are true.
Q 3 - Which of the following is true about JDOM Parser?
A - It is of low memory footprint.
Answer : C
Explaination
JDOM Parser is of low memory footprint and is nearly as fast as SAX.
Q 4 - Which of the following class of StAX parser specifies methods for creating an event?
Answer : B
Explaination
XMLEventWriter specifies methods for creating an event.
Q 5 - XPath defines the parts of an XML document like element, attribute, text, namespace, processing-instruction, comment, and document nodes.
Answer : A
Explaination
XPath defines the parts of an XML document like element, attribute, text, namespace, processing-instruction, comment, and document nodes.
Q 6 - Which of the following XPath expression selects the parent of the current node?
Answer : B
Explaination
.. selects the parent of the current node.
Q 7 - Which of the following is true about Attribute Class of DOM4J Parser?
A - It represents the entire XML document. A Document object is often referred to as a DOM tree.
C - It represents Element, Attribute or ProcessingInstruction.
Answer : D
Explaination
Attribute Class represents an attribute of an element. Attribute has method to get and set the value of attribute. It has parent and attribute type.
Q 8 - When to use a SAX Parser?
A - You can process the XML document in a linear fashion from the top down.
B - You are processing a very large XML document whose DOM tree would consume too much memory.
C - The problem to be solved involves only part of the XML document
Answer : D
Explaination
In all of the above situations, SAX parsing is preferred.
Q 9 - What are the advantages of JDOM parser?
A - flexibility and easy maintainablity of xml parsing code.
Answer : C
Explaination
JDOM gives java developers flexibility and easy maintainablity of xml parsing code. It is light weight and quick API.
Q 10 - Which method of the following of StAX Parser can be used to obtain characters such a CDATA, whitespace etc?
Answer : C
Explaination
Characters asCharacters() of XMLEventReader class can be used to obtain characters such a CDATA, whitespace etc.
To Continue Learning Please Login
Login with Google