• 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

dtd question / ambiguous content model. (from an old ibm test)

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello:
I am preparing for the ibm xml developer certification and i found an old copy of one of ibm's tests online -> http://www.certificationguru.com/solution.htm
One of the answers to a dtd question seems incorrect, and i am wondering if anyone else agrees with me (or if u disagree pls clue me in as to what i am missing ;^)

question 16 indicates that the following dtd content model is *not allowed*
<!element Customer ((Name, Ship-to-address) | (Name, Bill-to-address))>
it is refered to as a "non-deterministic content model"...
I tried this out with little xml doc and a dtd as follows ->
<?xml version="1.0"?>
<!DOCTYPE note SYSTEM "note.dtd"
>
<note>
<name>foo</name>
<bill-to>foo</bill-to>
</note>

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
note.dtd
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
<!ELEMENT note ( (name, ship-to) | (name, bill-to) ) >
<!ELEMENT name (#PCDATA)>
<!ELEMENT ship-to (#PCDATA)>
<!ELEMENT bill-to (#PCDATA)>
well... it works for me ! So where is the ambiguity in this content model ?
thanks very much for your help ..
chris
 
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
Good catch! I remember I also wondered about non-"deterministic content model" but never bothered to check... Here is the best possible explanations, I could find:
http://www.oasis-open.org/cover/ambiguousContentModels200101.html
(actually, two of them )
Anyway, here is what XML specification says:
"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."
http://www.w3.org/TR/REC-xml#determinism
Note the verb "may".
[ June 18, 2002: Message edited by: Mapraputa Is ]
reply
    Bookmark Topic Watch Topic
  • New Topic