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

Q 2 - Which of the following component represent actual content of an element or attribute in DOM Parsing?

A - Text

B - Element

C - Attr

D - Document

Answer : A

Explaination

Text represents the actual content of an Element or Attr.

Q 3 - Which component of JDOM Parser represents DOM tree?

A - Document

B - Element

C - Attribute

D - Text

Answer : A

Explaination

Document represents the entire XML document. A Document object is often referred to as a DOM tree.

Q 4 - Which of the following class of StAX parser provide iterator of events which can be used to iterate over events as they occur while parsing the XML document?

A - XMLEventReader

B - XMLEventWriter

C - Both of the above.

D - None of the above.

Answer : A

Explaination

XMLEventReader provide iterator of events which can be used to iterate over events as they occur while parsing the XML document.

Q 5 - XPath is official recommendation of World Wide Web Consortium (W3C).

A - true

B - false

Answer : A

Explaination

XPath is official recommendation of World Wide Web Consortium (W3C).

Q 6 - Which of the following XPath expression ensures that selection starts from the current node that match the selection?

A - .

B - /

C - ./

D - //

Answer : D

Explaination

// ensures that selection starts from the current node that match the selection.

Q 7 - Which of the following method of DOM4J Parser gets the XML node at particular index in the element?

A - Document.node(index)

B - Dom4j.node(index)

C - Element.node(index)

D - Node.node(index)

Answer : C

Explaination

Element.node(index) gets the XML node at particular index in the element.

Answer : C

Explaination

XML Parser provides way how to access or modify data present in an XML document.

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.

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
E-Books Store