Anda di halaman 1dari 6

1. Which of the following packages in the JAXP API provides mapping from XML to Java? a) javax.xml b) javax.xml.datatype c) javax.xml.

namespace d) javax.xml.parsers 2. Which of the following interfaces implemented by the parser writers is used to register users for handling callbacks? a) Parser b) AttributeList c) Locator d) ErrorHandler 3. Which of the following are the standard classes provided by SAX? 1. InputSource 2. SAXException 3. ParserFactory a) b) c) d) 1, 2 2, 3 1, 3 1, 2, 3

4. Which of the following DOM interfaces provides the primary data type for the entire document structure? a) Document b) Element c) Node d) Entity 5. TrAX consists of which of the following classes? 1. OutputKeys 2. Transformer 3. TransformerFactory a) 1, 2 b) 2, 3 c) 1, 3 d) 1, 2, 3 6. Which of the following interfaces of TrAX reports an error that would have occurred in the source document or transformations instructions? a) ErrorListener b) Result c) SourceLocator d) None of the above

7. Which of the following are the merits of SAX parser? 1. Simplicity 2. Less Memory Usage 3. Larger Footprint 4. Focus on Real Content a) 1, 2, 3 b) 2, 3, 4 c) 1, 2, 4 d) 1, 2, 3, 4 8. Which of the following is not a package present in JAXP for SAX? a) org.xml.sax b) org.xml.sax.ent c) org.xml.sax.helpers d) None of the above 9. Which of the following interfaces are present in JAXP for SAX? 1. XMLReader 2. XMLWriter 3. XMLFilter 4. LexicalHandler a) 1, 2, 3 b) 2, 3, 4 c) 1, 3, 4 d) 1, 2, 3, 4 10. Which of the following are the important classes and interfaces in the Content Parsing APIs? 1. ContentHandler 2. DefaultHandler 3. SAXParser a) 1, 2 b) 2, 3 c) 1, 3 d) 1, 2, 3 11. SAX includes which of the following events to be utilized in special situations? 1. Namespaces 2. Entities and Entity Declarations 3. Ignorable Whitespace 4. Processing Instructions a) 1, 2, 3 b) 2, 3, 4 c) 1, 3, 4 d) 1, 2, 3, 4

12. Which of the following are the methods of the Locator Interface? 1. getPublicId() 2. getSystemId() 3. getRowNumber() (getLineNumber()) 4. getColumnNumber() a) 1, 2, 3 b) 2, 3, 4 c) 1, 2, 4 d) 1, 2, 3, 4 13. Which of the following types of errors may occur during the processing of XML documents? 1. Fatal Errors 2. Non-Fatal Errors 3. Warnings a) 1, 2 b) 2, 3 c) 1, 3 d) 1, 2, 3 14. Which of the following is not a method of XMLFilter? a. getParent() b. setParent() c. setFilter() d. None of the above 15. The XML filter in combination with the ContentHandler interfaces enables which of the following? 1. Filtering Elements 2. Filtering Tags 3. Filtering Attributes a) 1, 2 b) 2, 3 c) 1, 3 d) 1, 2, 3 16. Which of the following are the advantages of the SAX? a) No random access possible. b) Difficult to perform complex searches. c) Cannot update documents d) None of the above 17. Which of the following methods of DefaultHandler class retrieves the notification of processing an instruction? a) processInstruction() b) processingInstruction()

c) processInstructions() d) defaultInstruction() 18. Which of the following are the benefits of XML parsing? 1. Language Independent 2. Code Independent 3. Flexibility 4. Suitability a) 1, 2, 3 b) 2, 3, 4 c) 1, 3, 4 d) 1, 2, 3, 4 19. Which of the following languages are predecessors of XML language? 1. SGML 2. HTML 3. Java a) 1, 2 b) 2, 3 c) 1, 3 d) 1, 2, 3 20. Which of the following are true about JAXP API? 1. It enables Java to process XML data. 2. It doesn't support the standards of Extensible Stylesheet Language Transformations. 3. It controls over the presentation of data and converts the data from XML to other forms. 4. It provides two standard parsers SAX and DOM for parsing an XML document. a) 1, 2, 3 b) 2, 3, 4 c) 1, 3, 4 d) 1, 2, 3, 4

Parser This is the main interface to a SAX parser: it allows the user to register handlers for callbacks, to set the locale for error reporting, and to start an XML parse. AttributeList This simple interface allows users to iterate through an attribute list -the parser can implement it in the same class as the SAX driver, or

implement it in a separate class (it does not need to be persistent). There is a convenience implementation available in the org.xml.sax.helpers.AttributeListImpl. Locator This simple interface allows users to find the current location in the XML source document -- the parser can implement it in the same class as the driver, or implement it in a second class (it does not need to be persistent). Standard SAX Classes (org.xml.sax package) SAX consists mostly of interfaces rather than classes, but the interfaces refer to two standard exception classes, and a third is provided for universal convenience. These classes are useful for both parser and application writers. InputSource This class contains all of the necessary information for a single input source, including a public identifier, system identifier, byte stream, and character stream (as appropriate). The application must instantiate at least one InputSource for the Parser, and the EntityHandler may instantiate others. SAXException This class represents a general SAX exception. SAXParseException This class represents a SAX exception tied to a specific point in an XML source document. HandlerBase This class provides default implementations for DocumentHandler, ErrorHandler, DTDHandler, and EntityResolver: parser writers can use this to provide a default implementation when the user does not specify handlers, and application writers can subclass this to simplify handler writing. Java-Specific Helper Classes (org.xml.sax.helpers package) These classes are not part of the core SAX distribution, and may not be available in SAX implementations in other languages: they are provided simply as a convenience for Java programmers.

ParserFactory An application can use the static methods in this class to load SAX parsers dynamically at run time, based on the class name. AttributeListImpl An application can use this convenience class to make a persistent copy of an AttributeList, or parser can use it to supply a default implementation of AttributeList to the application. LocatorImpl An application can use this convenience class to make a persistent snapshot of a Locator's values at a specific point in the parse. is a general exception that occurs during the course of a transformation. A transformer exception may wrap another exception, and if any of the TransformerException.printStackTrace() methods are called on it, it will produce a list of stack dumps, starting from the most recent. The transformer exception also provides a SourceLocator object which indicates where in the source tree or transformation instructions the error occurred.TransformerException.getMessageAndLocation() may be called to get an error message with location info, andTransformerException.getLocationAsString() may be called to get just the location string.
TransformerException

Anda mungkin juga menyukai