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 - 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 - 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.

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.

Answer : C

Explaination

The DOM is a common interface for manipulating document structures. One of its design goals is that Java code written for one DOM-compliant parser should run on any other DOM-compliant parser without changes.

Answer : C

Explaination

JDOM is an open source, java based library to parse XML document and it is typically java developer friendly API.

Answer : C

Explaination

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


java_xml_questions_answers.htm

Advertisements