• 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 ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

Sample DTD Question #3

 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
Oh, sure, you could do that. Or you could eat some pie. While reading this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic