• 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Junilu Lacar
  • Tim Cooke
  • Jeanne Boyarsky
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • salvin francis
  • fred rosenberger
  • Frits Walraven

certification primer error?

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 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...
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,
permaculture is a more symbiotic relationship with nature so I can be even lazier. Read tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic