The moose likes Product and Other Certifications and the fly likes need help with practise questions. Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Professional Certification » Product and Other Certifications
Reply Bookmark "need help with practise questions." Watch "need help with practise questions." New topic
Author

need help with practise questions.

Rajesh Parab
Greenhorn

Joined: Dec 04, 2001
Posts: 6
Hi all, could anybody help me with following questions please?
Thx.
Rajesh
1. When using a SAX2 parser, a listener can do which of the following in order to get called back by the parser on events related to ALL types of XML Constructs?

a) Implement EntityResolver, DTDHandler, ContentHandler and ErrorHandler.

b) Implement DocumentHandler interface.

c) Implement ContentHandler interface.

d) Create a subclass of the DefaultHandler class.


2. If two DOM nodes are equivalent, which of the following are TRUE?
I. The DOM nodes have the same node type and node name.
II. The node data are the same.
III. The collection of attribute names are the same.

a) I and II only

b) I and III only

c) II and III only

d) I, II and III


3. An XPath expression returns "hello" in a text node when the expression is processed on an XML document. The XML document is well-formed and valid, but does not contain "hello". Which of the following BEST explains the situation?


b) The XSLT processor resolved the entity references.

c) An incorrect relative location path is specified with respect to the current context node.

d) There is a missing "/" at the end of the location path.

e) There is a missing "@" somewhere in the location path.
Nitin Gujral
Greenhorn

Joined: Jan 19, 2001
Posts: 17
1 - d
DefaultHandler provides default implementations for all of the callbacks in the four core SAX2 handler classes.
2 - d
For two DOM nodes to be equivalent their collection of attribute names should be same, their data should be same and they should have same name and type
3 - b
Rajesh Parab
Greenhorn

Joined: Dec 04, 2001
Posts: 6
Thanks a lot, Nitin. My overall feeling is that exam 141 is much demanding than it's predecessor.
All the best guys!
Cheers,
Rajesh.
Niharika Srivastav
Ranch Hand

Joined: Dec 12, 2001
Posts: 32
Hi,
the answer to Q1 is a and d.
Good Luck!
Niharika
Doug Wang
Ranch Hand

Joined: Oct 05, 2001
Posts: 445
Originally posted by Nitin Gujral:
1 - d
DefaultHandler provides default implementations for all of the callbacks in the four core SAX2 handler classes.
a is also ok. There are 2 correct choices.
3 - b
Nitin, can you give some explanation for this choice? Thanks.

Doug


Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep
Nitin Gujral
Greenhorn

Joined: Jan 19, 2001
Posts: 17
Hi Doug,
For 3 as the statement is
The XML document is well-formed and valid, but does not contain "hello".
So whatever your XPath expression may be, it is not goiing to return you "hello". So, I think the only probable cause is the option 'b' i.e. the XSLT processor resolved the entity references one of which may contain "hello".
Your thoughts?
Doug Wang
Ranch Hand

Joined: Oct 05, 2001
Posts: 445
Hi, Nitin
Look at the following XPath expressions that all return "hello":
"hello" itself is a legal XPath expressions. or
concat("hel","lo")
x element (the expression may be constructed as //x) assumes the following XML fragment (there is only one x in the doc):
<x>h<y/>e<y/>l<y/>l<y/>o</x>
substring(comment(),1,5) assumes the following comment and it is the first comment:
<!-- hello world -->
...... many like
Do I go picky or I misunderstand the Q?
I am expecting your thoughts.

Doug :roll:
Nitin Gujral
Greenhorn

Joined: Jan 19, 2001
Posts: 17
Hi Doug,
Your examples are perfectly valid, but I think the other options except 'C' won't satisfy the conditions specified in the question.
Nitin
 
 
subject: need help with practise questions.
 
Threads others viewed
need answers
Put a node into a new xml document
Errors in DOM/SAX Mock exams ???
Suspected typo in practice question
questions on IBM "s sample test
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture