Forums Register Login

Qestion from ibm sample test

+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
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).]
+Pie Number of slices to send: Send
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>
+Pie Number of slices to send: Send
I checked the link. It is quite useful and cleared my doubt.
Thanks Map and Menon.
Sanjay
+Pie Number of slices to send: Send
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
This tiny ad is suggesting that maybe she should go play in traffic.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1019 times.
Similar Threads
Need help with some sample questions...
DTD question
IBM practice test question 16
content model question
DTD
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 19, 2024 00:08:17.