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.
Q 1 - Which of the following parses the document in similar fashion to SAX parser but in more efficient way?
StAX Parser parses the document in similar fashion to SAX parser but in more efficient way.
Q 2 - Which of the following is true about DOM Parser?
When you parse an XML document with a DOM parser, you get back a tree structure that contains all of the elements of your document. The DOM provides a variety of functions you can use to examine the contents and structure of the document.
Q 3 - Which of the following method get called when document ends in SAX parsing?
endDocument() method is called at the end of a document.
Q 4 - Which of the following class of StAX parser specifies methods for creating an event?
XMLEventWriter specifies methods for creating an event.
Q 5 - XPath uses a path expression to select node or list of nodes from an xml document.
XPath uses a path expression to select node or list of nodes from an xml document.
. selects the current node.
Q 7 - Which of the following is true about Attribute Class of DOM4J Parser?
Attribute Class represents an attribute of an element. Attribute has method to get and set the value of attribute. It has parent and attribute type.
Q 8 - What is a SAX Parser?
SAX Parser is an event-based parser for xml documents.SAX Parser is PUSH API Parser so that client application is required to get information when SAX parser notifies the client application that information is available.
Q 9 - What is a StAX Parser?
StAX is a JAVA based PULL API to parse XML document. It is very quick API and uses streams.
Q 10 - Which method of the following of StAX Parser can be used to add start element of given name?
writeStartElement(String localName) of XMLStreamWriter class can be used to add start element of given name.