File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

PUBLIC in DTD

 
Hari babu
Ranch Hand
Posts: 208
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1183
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
stephen Kang
Ranch Hand
Posts: 53
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Mapraputa Is
Leverager of our synergies
Sheriff
Posts: 10065
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
stephen Kang
Ranch Hand
Posts: 53
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi, that's food for thought
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic