• 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
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Sample DTD Question #3

 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The following question is from the sample DTD exam on this site. It gives (a) and (c) as the correct answers. I don't think (c) is correct because the ] is misplaced. Am I wrong?
3. Which of the following code is valid?
a) <!DOCTYPE test [ <!ELEMENT test (#PCDATA)>]>
b) <!DOCTYPE test [ <!ELEMENT test.dtd
(elm1|elm2|#PCDATA) >]>
c) <!DOCTYPE test [ <!ELEMENT test.dtd
(#PCDATA|elm1|elm2)* >]>
<!ELEMENT elm1 (#PCDATA)>
<!ELEMENT elm2 (#PCDATA)>
d) <!DOCTYPE test [ <!ELEMENT test test (#PCDATA)>]>
e) <!DOCTYPE test [ <!ELEMENT test "test" (#PCDATA)>]>
 
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You are right - C doesn't look right. Even after placing the ]> in the correct place, the root element test.dtd does not match the DOCTYPE declaration.
Cheers,
Dan
 
It is difficult to free fools from the chains they revere - Voltaire. tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic