- 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 parses the document in similar fashion to SAX parser but in more efficient way?
Answer : D
Explaination
StAX Parser parses the document in similar fashion to SAX parser but in more efficient way.
Q 2 - Which of the following method returns the root element of the document in DOM Parsing?
Answer : B
Explaination
Document.getDocumentElement() returns the root element of the document in DOM Parsing.
Q 3 - Which of the following method get called when element starts in SAX parsing?
Answer : C
Explaination
startElement() method is called at the start of an element.
Q 4 - Which component of JDOM Parser represents comments in a XML document?
Answer : A
Explaination
Comment represents comments in a XML document.
Q 5 - Which of the following is true about XPath?
A - XPath is used to traverse elements and attributes of an XML document.
Answer : C
Explaination
XPath is used to traverse elements and attributes of an XML document. XPath provides various type of expressions which can be used to enquire relevant information from the XML document.
Q 6 - Which of the following XPath expression selects all student elements no matter where they are in the document?
Answer : D
Explaination
//student selects all student elements no matter where they are in the document.
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.
Answer : A
Explaination
SAX Parser is PUSH API Parser so that client application is required to get information when SAX parser notifies the client application that information is available.
Answer : A
Explaination
Yes! Using SAX parser, we can parse, modify a XML document.
Q 10 - Which of the following predicate selects the last student element that is the child of the class element?
Answer : B
Explaination
/class/student[last()] predicate selects the last student element that is the child of the class element.