Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Qestion from ibm sample test

 
Sanjay Mishra
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please refer to the following question which is from the ibm sample test.
16. Which one of the following XML content models is NOT allowed?
a.<!element Customer (Name, Ship-to-address?, Bill-to-address?)>
b.<!element Customer ((Name, Ship-to-address) | (Name, Bill-to-address))>
c.<!element Customer (Name, (Ship-to-address | Bill-to-address)?)>
d.<!element Customer (Name, (Ship-to-address, Bill-to-address)?)>
The given answer is b whereas I am able to validate(f7) it in xml spy.
Comments please.
Sanjay
 
Mapraputa Is
Leverager of our synergies
Sheriff
Posts: 10065
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe it has something to do with ambiguity problem. Should be described here: http://www.xml.com/axml/target.html#determinism
But for some reason I cannot load the whole document Sanjay, can you read it?

[This message has been edited by Mapraputa Is (edited May 16, 2001).]
 
Hema Menon
Ranch Hand
Posts: 569
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Quote from the link shown by Map. Self explanatory. Why xmlspy validates it? don't know
<Quote>
SGML requires deterministic content models (it calls them "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 parser 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 parser doesn't need to look ahead to see what follows; either c or d would be accepted.

<unquote>
 
Sanjay Mishra
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I checked the link. It is quite useful and cleared my doubt.
Thanks Map and Menon.
Sanjay
 
David Roberts
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's kind of weak that's it's hard to test for. MSXML4 also allows it. Has anyone tried it with Xerces?
------------------
David Roberts - SCJP2,MCP
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic