• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

DTD question

 
mary morris
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is a question on the IBM demo test.
The correct answer is c. I see this, I see why it is not b, but what is wrong with a and d?
Consider the following content models: <!ELEMENT doc (title?, chap*)> <!ELEMENT title (#PCDATA)> <!ELEMENT chap (sect+)> <!ELEMENT sect (para+)> <!ELEMENT para (#PCDATA)>Which of the following XML instances would be successfully validated against this DTD?
A.<doc> <chap> <para>Text</para> </chap></doc>
B.<doc> <chap> <sect> <para>Text</para> </chap> </doc>
C.<doc> <title>Text</title></doc>
D.<doc> <title>Text</title> <sect> <para>Text</para> </sect></doc>
 
Micheal Jacob
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
In A, sect should be there inside char, so it is wrong
in B,sect is not closed.
in D, char itself is not there.
so c is the correct answer
Micheal
 
mary morris
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Micheal
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic