• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

another sample question

 
jim yin
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 662
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 662
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What about the ContentHandler thing
 
jim yin
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic