The moose likes Product and Other Certifications and the fly likes PUBLIC in DTD Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Product and Other Certifications
Bookmark "PUBLIC in DTD" Watch "PUBLIC in DTD" New topic


Hari babu
Ranch Hand

Joined: Jun 25, 2001
Posts: 208
Hi all,
In one of the DTD Declaration in an XML, i found this
<!DOCTYPE application PUBLIC '-//Sun Microsystems, Inc.//DTD J2EE Application 1.2//EN'>
Many say that PUBLIC is used when you have publicised the DTD. Now if i use this declaration when my application is validating the XML against DTD where will it search for the DTD ? or should i specifythe URL (of sun site in above case) ? I think specifying URL location is as good using SYSTEM instead of PUBLIC. Also in one of the book they say PUBLIC is used for internal purpose.Some one please help.
Dan Drillich
Ranch Hand

Joined: Jul 09, 2001
Posts: 1183
The specification has the following definitions -

It means that the 'PUBLIC' part consists of two quoted strings (separated by space - S).
The first one is the public ID, which uniquely identifies the XML application in use.
The second part is a URI. It is the URI, which is in practice being used by the XML parsers to actually validate the document (XML in a nutshell page #30).

William Butler Yeats: All life is a preparation for something that probably will never happen. Unless you make it happen.
stephen Kang
Ranch Hand

Joined: Jul 26, 2002
Posts: 53
hi hari,
i don't think your application search for PUBLIC dtd. Isn't it just unique namespace differentiate the namespace amongst various name sources?
you could find out the DTD in that site, but even though they don't provide it, it wouldn matter to validate your xml file. For example, when you make a client application to connect the Server (in this case SUN), you should follows their DTD as they provided to match the name and type. In this case, you can differentiate your namespace and theirs. It they don't have specific DTD file, they should provide xml file has a DTD information or just DTD to work your application.
correct me if i am wrong.

Stephen Kang
Mapraputa Is
Leverager of our synergies

Joined: Aug 26, 2000
Posts: 10065
Here are two articles for those who want more details :roll:

Uncontrolled vocabularies
"I try my best to make *all* my posts nice, even when I feel upset" -- Philippe Maquet
stephen Kang
Ranch Hand

Joined: Jul 26, 2002
Posts: 53
hi, that's food for thought
I agree. Here's the link:
subject: PUBLIC in DTD
It's not a secret anymore!