![Java XML Tutorial](/java_xml/images/javaxml-mini-logo.jpg)
- 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.
![Questions and Answers](/images/questions_and_answers.png)
Q 1 - Which of the following provides options to parse XML, XPath and XSLT using Java Collections Framework and provides support for DOM, SAX and JAXP?
Answer : B
Explaination
DOM4J Parser is a java library to parse XML, XPath and XSLT using Java Collections Framework , provides support for DOM, SAX and JAXP.
Q 2 - Which of the following is true about SAX parsing?
A - SAX is an event-based parser for xml documents.
B - Unlike a DOM parser, a SAX parser creates no parse tree.
Answer : C
Explaination
SAX (the Simple API for XML) is an event-based parser for xml documents.Unlike a DOM parser, a SAX parser creates no parse tree.
Q 3 - Which component of JDOM Parser represents XML Element?
Answer : B
Explaination
Element represents an XML element. Element object has methods to manipulate its child elements,its text, attributes and namespaces.
Q 4 - Which method of JDOM Parser builds the JDOM document from the xml source?
Answer : A
Explaination
SAXBuilder.build(xmlSource) builds the JDOM document from the xml source.
Q 5 - XPath is one of the major element in XSLT standard and is must have knowledge in order to work with XSLT documents.
Answer : B
Explaination
XPath is one of the major element in XSLT standard and is must have knowledge in order to work with XSLT documents.
Q 6 - Which of the following XPath expression selects all student elements that are children of class?
Answer : D
Explaination
class/student selects all student elements that are children of class.
Answer : A
Explaination
Yes! Using DOM4J parser, we can parse, modify and create a XML document.
Answer : B
Explaination
Using XSD, DTD and XML structure can be validated easily.
Q 9 - What is a StAX Parser?
A - StAX is a JAVA based PULL API to parse XML document.
Answer : C
Explaination
StAX is a JAVA based PULL API to parse XML document. It is very quick API and uses streams.
Q 10 - Which of the following predicate selects the first student element that is the child of the class element?
Answer : A
Explaination
/class/student[1] predicate selects the first student element that is the child of the class element.