This week's book giveaway is in the Agile and Other Processes forum. We're giving away four copies of Real-World Software Development: A Project-Driven Guide to Fundamentals in Java and have Dr. Raoul-Gabriel Urma & Richard Warburton on-line! See this thread for details.
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
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.
posted 18 years ago
I checked the link. It is quite useful and cleared my doubt. Thanks Map and Menon. Sanjay