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

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

 
Chris Bedford
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • 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
 
Mapraputa Is
Leverager of our synergies
Sheriff
Posts: 10065
  • Mark post as helpful
  • send pies
  • 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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic