File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
Author

PUBLIC in DTD

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.
Hari
Dan Drillich
Ranch Hand

Joined: Jul 09, 2001
Posts: 1164
Hari,
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).
Cheers,
Dan


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
Sheriff

Joined: Aug 26, 2000
Posts: 10065
Here are two articles for those who want more details :roll:
http://www.xml.com/pub/a/2000/11/29/deviant.html
and: http://www.xml.com/pub/a/2000/04/12/deviant/index.html


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: http://aspose.com/file-tools
 
subject: PUBLIC in DTD
 
Similar Threads
i looked at log file and not know to correct
problem when adding a jsp-config to web.xml to make jspf recognized as XML formatted
HttpSessionListener
java.lang.Exception: Attempted to use a 5.0 DataSource outside of a 2.3 servlet
Error in "web-app" in deployment descriptor