File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes XML and Related Technologies and the fly likes question on XML Design questions(mock exam) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "question on XML Design questions(mock exam)" Watch "question on XML Design questions(mock exam)" New topic
Author

question on XML Design questions(mock exam)

tom gong
Ranch Hand

Joined: Jul 15, 2000
Posts: 36
I have a question on XML Design questions(mock exam by Ajith Kallambella)
question (4):
Which of the following should NOT be relied upon to locate information of interest when querying the inventory listing XML documents?
1 The element type of an element.
2 An attribute value specified on an element start tag.
3 A processing instruction contained by the element of interest
4 Comments on the element declaration for the element of interest
The answer is 3 and 4, but according to IBM Test 140 Sample Test question 27:
27. Which of the following should NOT be relied upon to locate information of interest when querying an XML document?
1, The element type of an element
2, An attribute value specified on an element start tag
3, A processing instruction contained by the element of interest
4, Comments on the element declaration for the element of interest
the answer is 4.
these two questions are almost same. can anybody tell me which answer is right?
thanks for help,
tom gong
Ajith Kallambella
Sheriff

Joined: Mar 17, 2000
Posts: 5782
We both agree why (4) is right. The issue is really about (3).
Processing instructions( a.k.a. PI ) are special directives meant to serve as a channel of communication between the XML document and the application processing the XML. A classic example is the <?xml declaration at the top of the document containing information about the version, the encoding type, the reference to schema doc etc.
Quote from the The annotated XML Specification -

In the real world, it is often very useful to post a yellow-sticky on a document saying "this is where the background music comes in" or "last time they edited, this was at the top of the screen", or the like. Processing Instructions (usually called PIs) are the solution. They are in the document, but are not part of the data

Even the W3C XML specification advices that the PI is not meant for, and should not be used for representing any content-related information.
Hope that clarifies your doubt.

------------------
Ajith Kallambella M.
Sun Certified Programmer for the Java�2 Platform.
IBM Certified Developer - XML and Related Technologies, V1.


Open Group Certified Distinguished IT Architect. Open Group Certified Master IT Architect. Sun Certified Architect (SCEA).
tom gong
Ranch Hand

Joined: Jul 15, 2000
Posts: 36
Thanks Ajith. Your help is very appreciated,
Tom Gong
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: question on XML Design questions(mock exam)
 
Similar Threads
Another set of Mock questions!!
xml declaration a PI?
some questions about exam
question on XML Design questions(mock exam)
Discussion about XML Certification