• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

certification primer error?

 
cyril vidal
Ranch Hand
Posts: 247
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear all,
I'd like to be sure.
I just was going through the certification primer for XML and related technologies written by Pradeep Chopra, especially the sample test:
I've got a problem with question 3 relative to DTD:
Given the following XML document:

Which of the following DTDs will successfully validate the XML document below?
...
Reponse B:


...
Pradeep says this answer B is false because:

root4 is not a part of the given XML document, and as per the DTD at least one instance of the root4 element must be present in any XML document that conforms to the DTD.

For me - I've tested it only with xerces and may be I am wrong .. - the error does not deal with root 4 element but with cardinal operator of root3 element that must be changef from ? to * (because root3 element appears twice).
So, the following code, with element root4 mentionned in the DTD but not in th instance is perfectly valid (at least with xerces):


AM i missing something here or the answer in primer is really not correct?
Thanks in advance for your response,
Cyril.
 
cyril vidal
Ranch Hand
Posts: 247
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've just made a test with IE6 and msxml3 and validation of the code:

is valid too...
 
Pradeep Chopra
Ranch Hand
Posts: 219
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Cyril,
My apologies for the delayed response.
Yes, you are correct. Choice B is incorrect because there should be * as an operator on root3 instead of ?. There is no problem with root4 element missing in the document. The DTD doesn't say that there should be at least 1 instance of root4. Thanks for valuable feedback.
Hope this helps.
Best wishes,
Pradeep
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic