• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Qestion from ibm sample test

 
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Leverager of our synergies
Posts: 10065
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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).]
 
Ranch Hand
Posts: 569
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I checked the link. It is quite useful and cleared my doubt.
Thanks Map and Menon.
Sanjay
 
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic