Java XML Online Quiz


Advertisements


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 : B

Explaination

XML stands for Extensible Markup Language.

Answer : C

Explaination

DOM stands for Document Object Model.

Q 3 - Which of the following method get called when element ends in SAX parsing?

A - startDocument()

B - endDocument()

C - startElement()

D - endElement()

Answer : D

Explaination

endElement() method is called at the end of an element.

Q 4 - Can we create an XML document using JDOM parser?

A - true

B - false

Answer : A

Explaination

Yes! Using JDOM parser, we can parse, modify or create a XML document.

Answer : C

Explaination

XPath is an official recommendation of the World Wide Web Consortium (W3C).It defines a language to find information in an XML file.

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 gets all the attributes of an element?

A - Element.attributes()

B - Dom4j.attributes()

C - Document.attributes()

D - Node.attributes()

Answer : A

Explaination

Element.attributes() gets all the attributes of an element.

Answer : A

Explaination

Parsing XML refers to going through XML document to access data or to modify data in one or other way.

Q 9 - Is StAX parser a PULL API?

A - true

B - false

Answer : A

Explaination

StAX parser is a PULL API. It means in case of StAX parser, client application need to ask StAX parser to get information from XML whenever it needs.

Answer : C

Explaination

In both of the above situations, StAX parser is preferred.


java_xml_questions_answers.htm

Advertisements