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
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.
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.