my dog learned polymorphism
The moose likes Product and Other Certifications and the fly likes sample questions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Product and Other Certifications
Bookmark "sample questions" Watch "sample questions" New topic

sample questions

David Wei

Joined: Jan 04, 2002
Posts: 17
Can anybody help me with the answers to the following sample questions
1. Reuse within an XML Schema can be achieved by reusing schema components that are:
a) Defined using the LIB attribute.
b) Defined within the same schema, such as new types.
c) Globally defined in other schemas, referenced via XREFs.
d) Globally defined in other schemas and included, differentiating via namespaces.

b & c?
2. Which of the following statements are TRUE about error handling in SAX2?
a) Parsing errors are divided into two categories: errors and warnings.
b) The default behaviors for warning() and error() callbacks is to do nothing.
c) The ErrorHandler is registered with the ContentHandler via the setErrorHandler() method.
d) Parsing continues after an error occurs.

3.An XML-based employee records application is populated from a back-end relational database. Each employee has a unique numeric employee ID number that serves as the database key for that employee. The XML has an associated DTD. Validating the employee ID data would be:

a) Handled by the parser associating the employee name to a unique ID attribute with the XML employee application providing the business logic or functionality.
b) Handled by the parser associating a unique ID element with the XML employee application providing the business logic or functionality.
c) Handled by the XML parser using a SAX parser and relying on event-handling to capture the value of a unique ID attribute and the XML employee application would deal with user interface and rendering issues.
d) Handled by the XML parser as a non-unique CDATA attribute, with verification, business logic and functionality being provided by the XML employee application.
e) Stored in an empID element, with a SAX parser capturing the element's character content and evaluating it, reporting the result to the XML employee application for further processing.

Nitin Gujral

Joined: Jan 19, 2001
Posts: 17
My take on these :
1- b is fine
but why the option 'c' whynot 'd'?
As only fatal errors would throw an exception.
Also, ErrorHandler is not registered with ContentHandlet but with the XMLReader.
3-I would go with 'c' because it servers well for the requirement of validation the employee ID data in the XML document.
I am confused about options 'a' and 'b' as they donot involve the validation of the XML document with the employee ID data. They are trying to associate some values with the XML data itself.
What's your inputs?
I agree. Here's the link:
subject: sample questions
It's not a secret anymore!