- 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 XML based on expression and is used extensively in conjuction with XSLT?
Answer : A
Explaination
XPath Parser parses the XML based on expression and is used extensively in conjuction with XSLT.
Answer : A
Explaination
Yes! Using DOM parser, we can parse, modify or create a XML document.
Q 3 - Which of the following method is used to read contents in SAX parsing?
Answer : B
Explaination
characters() method is called when character data is encountered and can be used to read contents.
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 - 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.
Answer : C
Explaination
@ selects attributes.
Q 7 - Which of the following method of DOM4J Parser gets all the attributes of an element?
Answer : C
Explaination
Node.valueOf(@Name) gets all the attributes of an element.
Q 8 - What is XML Parser?
A - XML Parser provides way how to access data present in an XML document.
B - XML Parser provides way how to modify data present in an XML document.
Answer : C
Explaination
XML Parser provides way how to access or modify data present in an XML document.
Q 9 - When to use a JDOM Parser?
A - You need to use the information in the document more than once.
B - You are a java developer and want to leverage java optimized parsing of XML.
Answer : C
Explaination
In both of the above situations, JDOM parser is preferred.
Q 10 - Which method of the following of StAX Parser can be used to retrieve value and attributes of element?
Answer : A
Explaination
StartElement asStartElement() of XMLEventReader class can be used to retrieve value and attributes of element.