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

Answer : D

Explaination

All of the above options are correct.

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 - Can we create an XML document using SAX parser?

A - true

B - false

Answer : B

Explaination

No! Using SAX parser, we can only parse or modify a XML document.

Q 4 - Which method of JDOM Parser builds the JDOM document from the xml source?

A - SAXBuilder.build(xmlSource)

B - Document.getRootElement()

C - Node.getRootElement()

D - Node.getChild(Name)

Answer : A

Explaination

SAXBuilder.build(xmlSource) builds the JDOM document from the xml source.

Q 5 - XPath uses a path expression to select node or list of nodes from an xml document.

A - true

B - false

Answer : A

Explaination

XPath uses a path expression to select node or list of nodes from an xml document.

Answer : D

Explaination

DOM4J is java optimized, it uses java collection like List and Arrays. It works with DOM, SAX, XPath and XSLT. It can parse large XML document with very low memory footprint.

Q 7 - Which of the following method of DOM4J Parser builds the DOM4J document from the xml source?

A - SAXReader.read(xmlSource)

B - Dom4j.read(xmlSource)

C - Document.read(xmlSource)

D - Node.read(xmlSource)

Answer : A

Explaination

SAXReader.read(xmlSource) builds the DOM4J document from the xml source.

Q 8 - XML is Extensible.

A - false

B - true

Answer : B

Explaination

In XML, custom tags can be created and used very easily.

Q 9 - Can we create an XML document using StAX parser?

A - true

B - false

Answer : A

Explaination

Yes! Using StAX parser, we can parse, modify and create a XML document.

Q 10 - Can we modify an XML document using StAX parser?

A - true

B - false

Answer : A

Explaination

Yes! Using StAX parser, we can parse, modify and even create a XML document.

java_xml_questions_answers.htm
Advertisements