File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Product and Other Certifications and the fly likes DTD question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Meteor in Action this week in the JavaScript forum!
JavaRanch » Java Forums » Certification » Product and Other Certifications
Bookmark "DTD question" Watch "DTD question" New topic

DTD question

Jayadev Pulaparty
Ranch Hand

Joined: Mar 25, 2002
Posts: 662
Which of the following are the correct definitions for an external DTD?

<!DOCTYPE name [ ]>

<!DOCTYPE name PUBLIC "fileName.dtd" "http://" >

<!DOCTYPE name EXTERNAL "fileName.dtd" >

<!DOCTYPE name SYSTEM "fileName.dtd" >

<!DOCTYPE name SYSTEM "fileName.dtd" "http://" >

I guess these are the correct answers; any ideas??

<!DOCTYPE name PUBLIC "fileName.dtd" "http://" >
<!DOCTYPE name SYSTEM "fileName.dtd" >
Dan Drillich
Ranch Hand

Joined: Jul 09, 2001
Posts: 1180
The syntax in the specification is defined to be -
ExternalID ::= 'SYSTEM' S SystemLiteral | 'PUBLIC' S PubidLiteral S SystemLiteral
So, in
<!DOCTYPE name PUBLIC "fileName.dtd" "http://" >
fileName.dtd is in the position for the public ID (PubidLiteral), but it's not a public ID namewise.
The second 'argument' should be the dtd name.
So, I think this one is wrong.
Have a lovely weekend,

William Butler Yeats: All life is a preparation for something that probably will never happen. Unless you make it happen.
I agree. Here's the link:
subject: DTD question