This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Sample DTD Question #1

 
Jeff X Williams
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The following is from the sample DTD exam on this site. The answer given is (b) only. Why is (d) not correct also?
1. Which of the following dtd code is valid?
a) <!ELEMENT test (#CDATA)>
b) <!ELEMENT test (#PCDATA)>
c) <!ELEMENT test (#ANY)>
d) <!ELEMENT test (this,that)*>
<!ELEMENT this(#PCDATA)>
<!ELEMENT that(#PCDATA)>
 
Dan Drillich
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The missing spaces
 
Jeff X Williams
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks. Where is a space needed, after the comma? I hope the real test doesn't focus on such minor details as a missing space.
 
Valentin Crettaz
Gold Digger
Sheriff
Posts: 7610
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
After the second (this) and third (that) element definition.
If D was correct the DTD would like like:
<!ELEMENT test (this,that)*>
<!ELEMENT this (#PCDATA)>
<!ELEMENT that (#PCDATA)>
 
Jayadev Pulaparty
Ranch Hand
Posts: 662
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah; i too checked this space stuff and the xml processor seem to be looking for all these little details;
BTW, can anyone let me know what is the exact difference b/w #PCDATA and #CDATA and why #CDATA is not allowed as the content for an element?
As far as i understand, #PCDATA will be parsed by the parser and hence cannot contain any mark-up text like --- < > ' ". I also understand that the parser resolves any of the entity references contained within the #PCDATA that it parses.
What about #CDATA?
Anyone please clarify
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic