This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes question on mock exam Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "question on mock exam" Watch "question on mock exam" New topic
Author

question on mock exam

Tracy Qi
Ranch Hand

Joined: Apr 23, 2001
Posts: 37
on DTD mock exam:
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)>]>
Answer : a c

Can anyone tell me why C is correct? I tried it. It fails.
Cannot have a DTD declaration outside of a DTD. Error processing resource 'file:///D:/Test/xml/QQEnglish/src/words.xml'. Line 4, Position 15
<!ELEMENT elm1 (#PCDATA)>
--------------^

Thanks
Raseswari Achanta
Ranch Hand

Joined: Sep 25, 2001
Posts: 30
Hi Tracy,
I believe the answer c will be correct if the document type declaration is closed after the element declaration.
c)<!DOCTYPE test [ <!ELEMENT test.dtd (#PCDATA|elm1|elm2)* >]>
<!ELEMENT elm1 (#PCDATA)>
<!ELEMENT elm2 (#PCDATA)>
Instead of the above option, check with the below one and try..
c)<!DOCTYPE test [ <!ELEMENT test.dtd (#PCDATA|elm1|elm2)* >
<!ELEMENT elm1 (#PCDATA)>
<!ELEMENT elm2 (#PCDATA)>
]>
Regards,
Raseswari.
Tracy Qi
Ranch Hand

Joined: Apr 23, 2001
Posts: 37
Thanks for the reply. But that's my question. The reason I ask is that This is the question from IBM sample test. And the answer says C is correct. Weird.
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: question on mock exam
 
It's not a secret anymore!