File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Product and Other Certifications and the fly likes another sample question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » Product and Other Certifications
Bookmark "another sample question" Watch "another sample question" New topic
Author

another sample question

jim yin
Ranch Hand

Joined: Aug 15, 2002
Posts: 111
19)
Consider the following rules that have been determined for a set of XML information elements: o Either Title or ShortTitle is required o Title must be followed by either P or Table o ShortTitle must always be followed by P Which content model BEST depicts these rules and provides the greatest flexibility for future changes?





a) ((Title, P) | (Title, Table) | (ShortTitle, P))

b) (((Title | ShortTitle), P) | (Title, Table))

c) ((Title, (P | Table)) | (ShortTitle, P))

d) (((Title, P?) | (Title, Table?)), (ShortTitle, P?))

For this one, I think a) is correct. But how about c), is it illegal to design like in the first part?
Jayadev Pulaparty
Ranch Hand

Joined: Mar 25, 2002
Posts: 662
I cannot exactly say why, but i answered this to be "c" in one of my practice exams. "c" fits perfectly to the description and i see a little duplication of things in "a". I repeat that i cannot totally justify my decision as to "why not 'a'"
Svetlana Petrova
Ranch Hand

Joined: Sep 26, 2002
Posts: 50
I always considered c) as the best answer, though b) looks fine to me too. There is nothing illegal with c), btw. In fact, all first 3 answers are good. But the question is:
"Which content model BEST depicts these rules and provides the greatest flexibility for future changes?"
a) doesn't provide flexibility; say, you will need to add LongTitle into requirements, than you will need to add more combinations if using a);
I was always trying to select between b) and c). And I still intuitively select c). I'm wondering what others think about this?
Now I've got 39 correct out of 44.
Jayadev Pulaparty
Ranch Hand

Joined: Mar 25, 2002
Posts: 662
What about the ContentHandler thing
jim yin
Ranch Hand

Joined: Aug 15, 2002
Posts: 111
I just tried out a short xml file, c) is logically correct. Then yes, c) should be the best answer in terms of flexibility.
Svetlana Petrova
Ranch Hand

Joined: Sep 26, 2002
Posts: 50
I'm going to repeat a test and try to make selections as you suggested. Since, now I get 39 correct out 44, it's not difficult to repeat the test and change just that one answer. That should prove, I think.
Kris Mann
Greenhorn

Joined: Oct 06, 2002
Posts: 8
XML Bible says,
It is required that content models in element type declarations be deterministic.
This requirement is for compatibility with SGML (which calls deterministic content models
"unambiguous"); XML processors built using SGML systems may flag non-deterministic
content models as errors.
For example, the content model ((b, c) | (b, d)) is non-deterministic, because given an
initial b the XML processor cannot know which b in the model is being matched without
looking ahead to see which element follows the b. In this case, the two references to b
can be collapsed into a single reference, making the model read (b, (c | d)). An initial b
now clearly matches only a single name in the content model. The processor doesn't need to
look ahead to see what follows; either c or d would be accepted.
That is why, c is correct.


Thanks<br />Kris
 
jQuery in Action, 2nd edition
 
subject: another sample question